Skip to content

ci: make golangci-lint v2 pass for the Go 1.26.10 bump - #981

Open
fraseragain wants to merge 1 commit into
chore/bump-gofrom
fix/golangci-v2-lint
Open

fraseragain wants to merge 1 commit into
chore/bump-gofrom
fix/golangci-v2-lint

Conversation

@fraseragain

Copy link
Copy Markdown

What

Targets #980 (Go 1.26.10 and golangci-lint v2). Its only failing check is "Lint / Golang", with 46 issues; this brings it to zero without changing chain logic.

  • staticcheck quick fixes (13): QF1007, QF1008 and QF1012 are editor quick-fix suggestions that golangci-lint v2 reports and v1 did not. Disabled in checks, alongside the existing -ST1003.
  • goconst (30): 15 are CLI argument literals in integration and upgrade test helpers under tests/; v1 ignored tests and the v2 rule only covered _test.go. 15 are exchange and denom names in x/oracle/keeper/migrations.go, which are migration data and should stay literal. Both paths are now excluded for goconst only.
  • gofumpt (3 in CI, 5 locally): redundant parentheses removed, for example (sdk.Coins)(nil) → sdk.Coins(nil) and (int64)(x) → int64(x). These are formatting only, with no change to behaviour, including in ante/tx_msg_filters.go and x/oracle/keeper/reward.go.

How it was tested

  • golangci-lint run (v2.15.0, same config): 0 issues. It was 46 on chore: Bump go #980.
  • go build ./... on golang:1.26.10: OK.
  • go test ./ante/... ./x/oracle/keeper/... on golang:1.26.10: both packages pass.
  • The local lint image runs Go 1.27.2, which flagged two extra test files for gofumpt; those are formatted too, so CI on 1.26.10 should also be clean.

Review notes

  • Excluding goconst for tests/ restores the v1 behaviour, so it is not a loosening. The oracle migrations exclusion is file-specific.
  • The two production files touched lose redundant parentheses only. Please check them, given they sit on the fee and reward paths.

Part of the October 2026 security remediation (tracker items S-013 and S-021).

🤖 Generated with Claude Code

- stop enforcing staticcheck quick-fix suggestions (QF1007, QF1008,
  QF1012), which golangci-lint v2 now reports
- exclude goconst for test helpers under tests/ and for oracle store
  migrations, which list exchange and denom names as data
- gofumpt: drop redundant parentheses in five files (no behaviour change)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants