-
Notifications
You must be signed in to change notification settings - Fork 38
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
Use staticcheck instead of golangci-lint #1688
base: main
Are you sure you want to change the base?
Conversation
This commit changes the definition of the "golint" make target. It now uses staticcheck instead of golangci-lint. Most of the value in golangci-lint is derived from staticcheck, and staticcheck on its own runs in about 25% of the time as golangci-lint. So, there is little reason to use golangci-lint. Additionally, golangci-lint configures staticcheck in a non-standard way. As such, some lint errors were masked. They have been fixed in this commit as well. Signed-off-by: Eric Chlebek <[email protected]>
Reviewers can see the lint errors for themselves by running this on the main branch:
|
changeType: eventChangeTypeAdded, | ||
event: event, | ||
} | ||
opts := cache.InformerOptions{ |
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.
Should we raise a different PR for this change?, I think we'll need a changelog entry for this, since we're cutting over to a new function.
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.
In my opinion this is a simpler change than it may seem outwardly. If you have a look at the definition of cache.NewInformer, it just calls cache.NewInformerWithOptions in the same way it's called here. There would be no change to communicate in the changelog.
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.
(cache.NewInformer is deprecated, and a notice has been added to switch to cache.NewInformerWithOptions)
This commit changes the definition of the "golint" make target. It now uses staticcheck instead of golangci-lint.
Most of the value in golangci-lint is derived from staticcheck, and staticcheck on its own runs in about 25% of the time as golangci-lint. So, there is little reason to use golangci-lint.
Additionally, golangci-lint configures staticcheck in a non-standard way. As such, some lint errors were masked. They have been fixed in this commit as well.