-
Notifications
You must be signed in to change notification settings - Fork 39.7k
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
golangci-lint update and support for Go 1.21 #119860
Conversation
Please note that we're already in Test Freeze for the Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Wed Aug 9 10:32:39 UTC 2023. |
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This is WIP because:
|
there may be a fix for the go1.21 / go-critic issue to try, see #119037 (comment) |
31b1d44
to
ee385d1
Compare
I've tried that fix by bumping the github.com/quasilyte/go-ruleguard dependency and that seems to work. |
In order to bump release branches to go1.21, we'll need to pick any required changes to support go1.21 back. Can this PR be split into the minimal set to run on go1.21, and a follow-up to switch to the new plugin interface to keep the size of the backports as small as possible? |
ee385d1
to
7f14288
Compare
https://github.com/golangci/golangci-lint/pull/4002/files added an env variable for suppressing the warning. This is included in this PR now. |
That release is the first one with official support for Go 1.21. go-ruleguard must be >= 0.3.20 because of quasilyte/go-ruleguard#449 with Go 1.21. golangci-lint itself doesn't depend on a recent enough release yet, so this was done manually.
32346d5
to
9742e27
Compare
/hold To prevent merging without additional approval from someone else. |
/retest |
/lgtm go ahead and open picks to release-1.25+ branches once this merges so those will be prepped for go1.21 whenever it makes it back to those branches |
LGTM label has been added. Git tree hash: fe6e939c574a952c423a80401bc8f0fc628036a1
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, pohly The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/sig testing |
Cherry-picks created. |
…0-origin-release-1.28 Automated cherry pick of #119860: update to golangci-lint v1.54.1 + go-ruleguard v0.4.0
…0-origin-release-1.27 Automated cherry pick of #119860: update to golangci-lint v1.54.1 + go-ruleguard v0.4.0
…0-origin-release-1.26 Automated cherry pick of #119860: update to golangci-lint v1.54.1 + go-ruleguard v0.4.0
…0-origin-release-1.25 Automated cherry pick of #119860: update to golangci-lint v1.54.1 + go-ruleguard v0.4.0
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
v1.54.0 is the first release with official support for Go 1.21. go-ruleguard
must be >= 0.3.20 because of
quasilyte/go-ruleguard#449 with Go
1.21. golangci-lint itself doesn't depend on a recent enough release yet, so
this was done manually.
One downside of updating golangci-lint to v1.54.0 without also updating
logcheck is that golangci-lint now complains about logcheck using the old
plugin API:
Related-to: kubernetes/release#3076
Special notes for your reviewer:
There is an issue with go-critic and ruleguard which needs a workaround in
verify-golangci-lint.sh
: the Go toolchain used for compiling the linter must not be inside a Go module.Does this PR introduce a user-facing change?