-
Notifications
You must be signed in to change notification settings - Fork 6.5k
chore: upgrade golangci-lint to v2 (release-2.14) #23305
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
chore: upgrade golangci-lint to v2 (release-2.14) #23305
Conversation
This commit upgrades the tooling references and configuration. Lint violations not fixed yet. Signed-off-by: Ville Vesilehto <[email protected]>
Signed-off-by: Ville Vesilehto <[email protected]>
Signed-off-by: Ville Vesilehto <[email protected]>
formatter: using msgAndArgs with non-string first element causes panic (testifylint) The assert.ElementsMatch function is being called with multiple list pairs in a single call, but it can only compare two lists at a time. Signed-off-by: Ville Vesilehto <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-2.14 #23305 +/- ##
================================================
+ Coverage 55.30% 55.33% +0.02%
================================================
Files 339 339
Lines 57361 57361
================================================
+ Hits 31726 31738 +12
+ Misses 22941 22937 -4
+ Partials 2694 2686 -8 ☔ View full report in Codecov by Sentry. |
|
Does the upgrade require enabling new linters? i.e. could we make this PR more minimal? |
|
Sure, I can disable more rules if we want to keep changes to the minimum. I believe the default set changed with v2 for staticcheck specifically |
|
Ah sure. Yeah I'd like to do whatever is the minimum necessary to unblock the go upgrade. |
b204dce to
bcaa7cf
Compare
Revert "chore: lint violations autofixed with --fix" This reverts commit 64e5905. Signed-off-by: Ville Vesilehto <[email protected]>
ignore most quick fixes to minimise impact of upgrading golangci-lint to v2 Signed-off-by: Ville Vesilehto <[email protected]>
bcaa7cf to
c9fe32f
Compare
|
Messed up DCO for the previous run but tests passed. I think we are close :) |
|
@crenshaw-dev feedback welcome on the current approach! Tests pass with the v2 linter now, with minimal changes |
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.
looks great, thanks!
Prep for Go version upgrade in #23294 by upgrading golangci-lint to the latest version for the
release-2.14branch.staticcheckrelated rules which were causing hundreds of linting errors, requiring breaking changes and manual labor. See diff for full list. My suggestion is that these could be improved in separate PRs one by one. Many of these are automatically fixable.testifylintrules which were also auto-fixable.Only tests required code changes:
assert.ElementsMatch()Separate commits in this PR hopefully help the review process.
Checklist: