Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

echlebek
Copy link
Collaborator

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.

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]>
@echlebek echlebek self-assigned this Oct 18, 2024
@echlebek echlebek requested a review from a team as a code owner October 18, 2024 00:16
@echlebek
Copy link
Collaborator Author

Reviewers can see the lint errors for themselves by running this on the main branch:

find . -type f -name 'go.mod' -exec dirname {} \; | xargs -L 1 bash -c 'cd "${0}" && staticcheck && cd'

changeType: eventChangeTypeAdded,
event: event,
}
opts := cache.InformerOptions{
Copy link
Contributor

@rnishtala-sumo rnishtala-sumo Oct 18, 2024

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants