Repository navigation
build: migrate to golangci-lint v2 - #3983
sebrandon1 wants to merge 1 commit into
Conversation
|
Hi @sebrandon1. Thanks for your PR. I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
9511884 to
08b5643
Compare
|
/approve |
|
/ok-to-test |
The golangci-lint v1 line is end of life, and v1.64.8 cannot read the v2 configuration format. Move the tool pin to the v2 module path and take the current release (v1.64.8 -> v2.15.0). The configuration is produced by `golangci-lint migrate` and then adjusted in two places: - staticcheck absorbed stylecheck in v2 and now also runs the stylistic QF quickfix checks. QF1001/1004/1006/1008 are switched off so the tool bump does not become a repo-wide refactor. - The newer staticcheck flags deprecations the v1 pin did not know about (Requeue, ListWatch.ListFunc/WatchFunc, SelfLink). Fixing those is a behaviour change - RequeueAfter is not a drop-in for Requeue, and the list/watch callbacks need context plumbing - so they are excluded with a comment rather than silently ignored. `make lint` reported 0 issues before and after the change. Signed-off-by: Brandon Palm <bpalm@redhat.com>
08b5643 to
205ab73
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tmshort The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
github.com/golangci/golangci-lint/v2), so Dependabot never proposed it and the pin has sat on v1 since the tool moved intogo.modin build: run pinned tools with go tool #3962.golangci.yamlto the v2 schema withgolangci-lint migrate, then switch off the new QF quickfix checks (QF1001/1004/1006/1008, 54 findings against long-unchanged code) and exclude nine newly-reportedSA1019deprecations (Requeue,ListFunc/WatchFunc,SelfLink) — migrating those is a behaviour change, not a rename, so they are tracked separatelymake lintis a required CI job (sanity.yaml→static-analysis), so the tool pin and the config change have to land in the same commit.golangci.yaml,go.modandgo.sumchange outsidevendor/(2,477 of the 2,480 files); review with-path:vendorJira
Test Plan
static-analysis(make lint vet),check-vendor,verify,unit,buildgo tool golangci-lint --versionreports v2.15.0, built with go1.26.3 to match thegodirectivemake lintreports 0 issues — no source files change, so lint output is unchanged apart from the exclusions listed aboveSummary by CodeRabbit