-
Notifications
You must be signed in to change notification settings - Fork 9.7k
ci: update golangci-lint to v2.0.2 and adjust configuration #16356
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
Conversation
05e21a9
to
0b6f490
Compare
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
0b6f490
to
c91d72c
Compare
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.
Pull Request Overview
This PR updates the golangci-lint configuration to v2.0.2, ensuring that both CI workflows and supporting configuration files are in sync with the new version. It also adjusts the configuration settings to include new formatters and enables staticcheck with custom exclusions.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
scripts/golangci-lint.yml | Updated the golangci-lint GitHub Action and version to v2.0.2 |
.golangci.yml | Revised configuration structure, added formatters, and configured staticcheck with custom rules |
.github/workflows/ci.yml | Updated the golangci-lint GitHub Action and version to v2.0.2 for CI consistency |
Files not reviewed (1)
- Makefile.common: Language not supported
Comments suppressed due to low confidence (2)
.golangci.yml:169
- [nitpick] Consider clarifying or addressing the FIXME note in the staticcheck configuration to ensure that the intended linting behavior is clear before merging. This will help prevent unexpected linting issues in dependent projects.
# FIXME: We should enable this check once we have fixed all the issues.
.golangci.yml:132
- [nitpick] Consider using consistent string quotation (e.g. double quotes) for configuration values across the file for better readability and consistency.
- allowTypesBefore: '*testing.T,testing.TB'
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.
Please see comments.
Can you tell me whether there's a bug regarding testify-lint's useless-assert rule?
I made a PR to fix issues found by golangci-lint v2.0.2 :) |
Yes but it is fixed by golangci/golangci-lint#5654 and will be included in golangci-lint next release |
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
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 think it looks good at this point, except adding output.sort-order
configuration equivalent to the default is unnecessary.
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
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.
LGTM, thanks!
Description
This updates golangci-lint to v2.0.2 with the associated configuration in workflows and script
Note: With the modification of script, it will require an update for every dependent project.