Skip to content

Migrate golangci-lint to v2#177

Open
AntiD2ta wants to merge 1 commit into
masterfrom
update-golangci-lint-v2
Open

Migrate golangci-lint to v2#177
AntiD2ta wants to merge 1 commit into
masterfrom
update-golangci-lint-v2

Conversation

@AntiD2ta

@AntiD2ta AntiD2ta commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

This unblocks the lint job for all open PRs.

golangci-lint v1.64.8 (bundled go1.24 type-checker) cannot type-check the
go1.26 standard library that GitHub's runners now provide via setup-go
'^1.22', producing "file requires newer Go version go1.26" errors that
break the lint job on every PR since ~2026-06-26 (master passed on 06-23,
before the runner image started serving go1.26.4).

Bump golangci/golangci-lint-action to v7 (pinned golangci-lint v2.12.2,
built against go1.26) and migrate .golangci.yml to the v2 schema via
`golangci-lint migrate`, preserving the project's effective ruleset:

- enable-all -> default: all; stylecheck merged into staticcheck (-ST1000
  carried over); gofmt/gofumpt/goimports moved to the formatters section.
- Drop gci (now a formatter) and tenv (removed in v2) from the disable list.
- Disable wsl_v5 alongside wsl: v2 default:all enables both the deprecated
  alias and its replacement, so both must be off to keep wsl disabled.
- Disable new-in-v2 linters that conflict with established idioms:
  noinlineerr (the codebase uses inline `if err := ...` throughout) and
  modernize.
- Disable the deprecated gomodguard to silence its warning (consistent with
  depguard already being disabled).

Validated locally with golangci-lint v2.12.2 under go1.26: `config verify`
passes and a full run completes with no typecheck or deprecation warnings;
the only remaining findings are pre-existing prealloc/staticcheck issues
that only-new-issues filters on CI.
@AntiD2ta AntiD2ta changed the title Migrate golangci-lint to v2 (fix lint CI under go1.26) Migrate golangci-lint to v2 Jun 26, 2026
@AntiD2ta AntiD2ta self-assigned this Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant