chore: upgrade golangci-lint to 2.12.2#729
Conversation
WalkthroughThe PR updates golangci-lint to v2.12.2 in CI and local installation, disables ChangesLint configuration alignment
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Updates the repository’s linting toolchain to golangci-lint v2.12.2 (CI + local) and adjusts configuration/source annotations so the upgraded linter remains clean and CI stays green.
Changes:
- Bump CI golangci-lint version to
v2.12.2and pin the localmake lintinstaller to the same version. - Disable
goconstat the repo level to avoid new findings introduced by the upgrade. - Remove now-unused
//nolintdirectives surfaced bynolintlint.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
Makefile |
Pins local go install of golangci-lint to v2.12.2 to match CI. |
internal/utils/context.go |
Removes an unused //nolint:revive directive on the package clause. |
internal/fga/fga.go |
Removes unused //nolint:gosec suppressions on config fields. |
internal/build/build.go |
Removes an unused //nolint:revive directive near the package clause. |
.golangci.yaml |
Adds goconst to the disabled linters list under default: all. |
.github/workflows/main.yaml |
Updates golangci-lint-action linter version to v2.12.2. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Upgrades golangci-lint from v2.10.1 → v2.12.2 and resolves the new findings the upgrade surfaces, so CI stays green.
Changes
Version bump (local + CI kept in lockstep):
.github/workflows/main.yaml:golangci-lint-actionlinterversion: v2.10.1 → v2.12.2(the action pin itself,@ba0d7d2… # v9.3.0, is already latest — unchanged).Makefile: pin thegolangci-lintinstall to@v2.12.2(was@latest), so localmake lintmatches CI exactly.New findings cleared (all pre-existing; surfaced only by the newer linter):
goconst(50) — disabled repo-wide in.golangci.yaml. All 50 were repeated string literals in*_test.gofixtures, where extracting shared constants tends to hurt table-test readability more than it helps.nolintlint(4) — removed 4//nolintdirectives that v2.12.2 correctly reports as unused (the linters they suppressed no longer fire on those lines):internal/fga/fga.go://nolint:goseconAPITokenandClientSecret— verified gosec no longer flags these fields.internal/build/build.go://nolint:reviveon the package clause.internal/utils/context.go://nolint:reviveon the package clause.Verification
golangci-lint run -c .golangci.yaml ./...at v2.12.2 → 0 issues. The version bump and the source cleanups are intentionally in one commit: the removed directives are still live at v2.10.1, so the two are inseparable for a green CI.