-
Notifications
You must be signed in to change notification settings - Fork 410
Upgrade golangci-lint to v2 #7093
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
Comments
Hey @antoninbas - I've been chipping away at this for a week now. Could I get your advice? So far I've addressed all the staticcheck errors (on this branch https://github.com/petertran-avgo/antrea/commits/7093-bump-golang-ci-lint-v2/ ) which is pretty large. There are 1157 remaining gosec issues:
Which is when a method returns an error but we don't check it. Here's an example: https://github.com/antrea-io/antrea/blob/main/cmd/antrea-agent/agent.go#L382
Do you think it would be okay to ignore |
I did the conversion recently for another smaller repository. When I used the conversion tool that golangci-lint provides, it automatically added the I recommend using the conversion tool, focusing on moving to the v2 configuration, and trying to get to parity with what we have today (or as close as possible). If follow up changes are needed / desired (e.g., to enable more linters or rules, or to be more explicit about which rules are disabled), these changes should be performed in a separate PR IMO. |
Are you referring to the |
And thanks for the tip about |
Yes. I'd suggest running that first. |
Thank you! Reflecting on this now, I recall the exclusions list having extra (at the time I thought) "directories" that didn't make sense to me that I removed. |
* audited usage of unsafe to ensure it was done so correctly Fixes antrea-io#7093 Signed-off-by: Peter Tran <peter-pt.tran@broadcom.com>
* audited usage of unsafe to ensure it was done so correctly Fixes antrea-io#7093 Signed-off-by: Peter Tran <peter-pt.tran@broadcom.com>
* audited usage of unsafe to ensure it was done so correctly Fixes antrea-io#7093 Signed-off-by: Peter Tran <peter-pt.tran@broadcom.com>
* audited usage of unsafe to ensure it was done so correctly Fixes antrea-io#7093 Signed-off-by: Peter Tran <peter-pt.tran@broadcom.com>
golangci-lint has had a major version bump to v2
we should migrate to this new version
there is a migration guide available: https://golangci-lint.run/product/migration-guide/
The text was updated successfully, but these errors were encountered: