Update golangci-lint to v2.12.2 with canonical config #1

Merged
sneak merged 1 commits from golangci-v2.12.2 into main 2026-08-07 23:24:38 +02:00
Collaborator

Adopts the shared canonical .golangci.yml on branch golangci-v2.12.2.

Config change

  • The old config's top-level linters-settings block was silently ignored under the v2 schema; the canonical config puts settings under linters.settings, so the lll (88), funlen, cyclop, and dupl (100) thresholds now actually apply.
  • The four repo-specific disables (mnd, exhaustive, paralleltest, testpackage) are removed from the config so it stays byte-identical to canonical. Their previously approved exceptions (2026-07-06/07) now live as targeted in-code //nolint directives carrying the original approval dates: file-level //nolint:mnd on the 26 C-faithful gameplay files, file-level //nolint:testpackage on the 10 white-box test files, and per-switch //nolint:exhaustive on the 20 C-faithful switches. Reverting any of these exceptions is now a per-file/per-site decision instead of a package-wide one.

Real fixes

  • paralleltest: t.Parallel() added to all 32 tests (they already use isolated game instances and t.TempDir()); suite passes.
  • lll: all 24 overlong lines fixed (signatures wrapped, comments tightened or moved above).
  • mnd in term/tcell.go: control-code returns rewritten as character literals ('\b', '\x7f', '\x03').
  • wsl_v5: two defer-cuddle fixes in game/save.go and game/score.go (previously masked by same-line mnd findings via uniq-by-line).
  • dupl: the three identically-shaped item data tables in game/tables.go are marked //nolint:dupl — they are distinct game data, not duplicated logic.

No behavior changes; make check is green.

Version pin

There is no golangci-lint version reference anywhere in the repo to bump: no Dockerfile, no CI workflow, and make lint runs the host golangci-lint binary unpinned (currently v2.12.2 here). Per the rollout rules no new pinning infrastructure was invented.

Note: golangci-lint v2.12.2 warns that gomodguard is deprecated in favor of gomodguard_v2; that is a canonical-config concern, not repo-specific.

Adopts the shared canonical `.golangci.yml` on branch `golangci-v2.12.2`. ## Config change - The old config's top-level `linters-settings` block was silently ignored under the v2 schema; the canonical config puts settings under `linters.settings`, so the `lll` (88), `funlen`, `cyclop`, and `dupl` (100) thresholds now actually apply. - The four repo-specific disables (`mnd`, `exhaustive`, `paralleltest`, `testpackage`) are removed from the config so it stays byte-identical to canonical. Their previously approved exceptions (2026-07-06/07) now live as targeted in-code `//nolint` directives carrying the original approval dates: file-level `//nolint:mnd` on the 26 C-faithful gameplay files, file-level `//nolint:testpackage` on the 10 white-box test files, and per-switch `//nolint:exhaustive` on the 20 C-faithful switches. Reverting any of these exceptions is now a per-file/per-site decision instead of a package-wide one. ## Real fixes - `paralleltest`: `t.Parallel()` added to all 32 tests (they already use isolated game instances and `t.TempDir()`); suite passes. - `lll`: all 24 overlong lines fixed (signatures wrapped, comments tightened or moved above). - `mnd` in `term/tcell.go`: control-code returns rewritten as character literals (`'\b'`, `'\x7f'`, `'\x03'`). - `wsl_v5`: two defer-cuddle fixes in `game/save.go` and `game/score.go` (previously masked by same-line `mnd` findings via `uniq-by-line`). - `dupl`: the three identically-shaped item data tables in `game/tables.go` are marked `//nolint:dupl` — they are distinct game data, not duplicated logic. No behavior changes; `make check` is green. ## Version pin There is no golangci-lint version reference anywhere in the repo to bump: no Dockerfile, no CI workflow, and `make lint` runs the host `golangci-lint` binary unpinned (currently v2.12.2 here). Per the rollout rules no new pinning infrastructure was invented. Note: golangci-lint v2.12.2 warns that `gomodguard` is deprecated in favor of `gomodguard_v2`; that is a canonical-config concern, not repo-specific.
clawbot added 1 commit 2026-08-07 22:45:15 +02:00
Replace .golangci.yml with the shared canonical config. The old
config's top-level linters-settings block was silently ignored under
the v2 schema, so the lll/funlen/cyclop/dupl thresholds now actually
apply. The four repo-specific disables (mnd, exhaustive, paralleltest,
testpackage) move out of the config into targeted in-code nolint
directives carrying their original approval dates, keeping the config
byte-identical to the canonical one.

Fixes surfaced by the stricter settings: t.Parallel() added to all 32
tests, 24 overlong lines wrapped or their comments tightened, tcell
control-code returns rewritten as character literals, dupl markers on
the identically-shaped item data tables, and two wsl_v5 defer cuddles.

No behavior changes. The repo has no golangci-lint version pin (no
Dockerfile or CI; make lint runs the host binary, currently v2.12.2),
so there was nothing to bump.
sneak merged commit d6cd418f38 into main 2026-08-07 23:24:38 +02:00
sneak deleted branch golangci-v2.12.2 2026-08-07 23:24:38 +02:00
Sign in to join this conversation.