-
Notifications
You must be signed in to change notification settings - Fork 28
build: migrate golangci-lint to v2 #258
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Lídia Tarcza <[email protected]>
Signed-off-by: Lídia Tarcza <[email protected]>
Signed-off-by: Lídia Tarcza <[email protected]>
Signed-off-by: Lídia Tarcza <[email protected]>
This reverts commit 8c3c3b2.
This reverts commit cb5f0d0.
Signed-off-by: Lídia Tarcza <[email protected]>
Signed-off-by: Lídia Tarcza <[email protected]>
pyrooka
left a comment
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.
I left a few comments to consider. Haven't tested all of them so expect lint failures, but we should keep things default and as strict as possible. Let me know if you have any questions!
These comments/suggestions also apply to IBM/platform-services-go-sdk#411
.golangci.yaml
Outdated
| disable: | ||
| - staticcheck |
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.
I looked into the changelog of golangci-lint and found this:
⚠️ Merge staticcheck, stylecheck, gosimple into one linter (staticcheck) (cf. Migration guide)
So after thinking about this a little I have to realize that completely disabling staticcheck is not a good idea as we also disable the other 2 - sorry for suggesting this previously! :)
Sooo, I'd recommend to disable only the rules that cause issues. I've found 2 ways to do that:
- Setting the
checkin thestaticcheckconfig (see here ) - Ignoring specific messages from the
staticchecklinter. Here is an example how to do it (at the bottom of the config in the linked section).
Sorry for the confusion!
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.
I prefer the approach of enabling and disabling rules inside the Nevermind I can't read 😅check in the linter's config. Only downside is that this way you have to list every single rule that you want to use with the linter. Although somehow this way it includes more rules with the linter as well.
Signed-off-by: Lídia Tarcza <[email protected]>
Signed-off-by: Lídia Tarcza <[email protected]>
Migrate golangci-lint to v2 from v1.