-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
style: fix lint errors and update lint timeout #9464
Conversation
* gocritic appendAssign fix * markdown trailing space and blank line fixes * change golangci-lint timeout to 5min
Codecov Report
@@ Coverage Diff @@
## master #9464 +/- ##
=======================================
Coverage 60.54% 60.55%
=======================================
Files 590 590
Lines 37287 37288 +1
=======================================
+ Hits 22577 22578 +1
Misses 12763 12763
Partials 1947 1947
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening a pull request! I added a couple suggestions and comments.
The only changes that I think are necessary is fixing the format in .golangci.yml
and maybe updating the changelog entry to be more specific. Let me know if you have any questions.
ff1e44f
to
aaa6465
Compare
Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes. This looks good to me.
For the pull request type, this is not necessarily a "fix". I think "style" would be better suited for this pull request given that the changes are not fixing a bug but rather fixing lint errors and the functionality of the code remains the same. I'm still not sure if the changelog entry is necessary but I think it's ok to leave it. I have updated the title and the checklist items to use the other template.
Description
Closes: #9460
Go linter errors
The go linter fails on many go files, I had to run gofmt -w -s . to recursively gofmt simplify all .go files at first. These changes were not picked up by git (crlf conversion or some such), otherwise there'd be over 1000 changes! It might be good to add this step to contributing.md. This issue may be due to my setup - I use a windows host and a linux guest vm where I do my build. The code is on the windows host filesystem and the cosmos-sdk folder is shared such that the guest vm can do builds against it.
Markdown linter failures - Extra spaces/newlines on .md files:
docs/core/encoding.md:201:163 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
docs/DOC_WRITING_GUIDELINES.md:12 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
docs/DOC_WRITING_GUIDELINES.md:13 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 3]
gocritic appendAssign error (this is the only real code change):
x/distribution/legacy/v043/helpers.go:22:18 gocritic appendAssign: append result not assigned to the same slice
make: *** [Makefile:335: lint] Error 1
I also uncommented the 5 minute timeout in the .golangci.yml as I couldn't get make to complete without increasing the timeout. My computer is a 2.6 Ghz Intel I7-10750, so I don't think its because my computer is slow.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...