-
Notifications
You must be signed in to change notification settings - Fork 20.5k
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
build: enable goimports and varcheck linters #16446
Merged
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ebf6df0
#15473 - add lint task to makefile
thomasmodeneis e79ce54
Merge branch 'master' of github.com:modeneis/go-ethereum
thomasmodeneis 8889632
add gofmt, misspell, goconst, unconvert, gosimple, deadline=10m, min-…
thomasmodeneis c41a7cc
fixing all linting errs
thomasmodeneis 9671bfc
add varcheck
thomasmodeneis a1b426a
Merge branch 'master' of github.com:ethereum/go-ethereum
thomasmodeneis a48f2a4
Merge branch 'master' of github.com:ethereum/go-ethereum
thomasmodeneis dea717b
goimports incorrectly removed valid imports, manually restoring all f…
thomasmodeneis b2e72fc
build: increasing deadline as travis build fails with error: (deadlin…
thomasmodeneis f77e0b4
build: revert the changes to import lists
thomasmodeneis 84c3ead
build: gofmt all files
thomasmodeneis 431af6b
build: run standard goimports on all files
thomasmodeneis ab0dcec
build: update script goimports+gofmt
thomasmodeneis 639a37d
build: remove vendorcheck
thomasmodeneis db5d83a
build: remove vendorcheck
thomasmodeneis 10ad506
build: remove deadline on lint job
thomasmodeneis fe98d8c
discv5: generate nodeevent
thomasmodeneis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
build: update script goimports+gofmt
- Loading branch information
commit ab0dcec27d917445851a275f7e0c5896d8a0dd82
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What's the purpose of this file?
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.
One of the reasons of linting errors was due to having code not properly formatted and not properly imported. There was no standard set for that. Now there is.
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.
goimports
is pretty much the standard tool used by any Go development environment. I don't really see the value of providing an extra utility method in our repo that is covered by the developer's editor anyway. I completely agree that the linter should enforce it, but its the developer's job to configure their dev environment, not ours.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.
When I started to work on this issue, I found that the devs are not really doing what you said is their job...
So I ran the goimports the way "I think" is the best way, splitting the imports in 3. Just to find out that this is not the proffered way here.
Also, running
goimports ./..
throws some errors, that I'm not sure how to fix, or even if they are really errors, so I added the script:So I added a "default" script to get this sorted and leave no room for errors.