Skip to content

🚨 golangci-lint default: all, as strict as possible - #23

Merged
simonhull merged 26 commits into
mainfrom
fix/round6-lint
Nov 12, 2026
Merged

simonhull merged 26 commits into
mainfrom
fix/round6-lint

Conversation

@simonhull

Copy link
Copy Markdown
Owner

Turns on golangci-lint default: all. No behavior, public API or CLI output change: the exported declarations (go doc -all .) are identical and BenchmarkOpenFile allocs/op are unchanged.

Config

  • default: all. Globally disabled, each with a written reason in .golangci.yml: exhaustruct (and exhaustruct_v5), wsl/wsl_v5, nlreturn, varnamelen, noinlineerr, testpackage, gosmopolitan, lll, tagalign, plus the deprecated gomodguard (its v2 stays on).
  • Formatters: gofumpt and goimports. depguard bans io/ioutil, math/rand v1, github.com/pkg/errors, golang.org/x/exp, log, encoding/json v1 (two tests moved to json/v2; the CLI already used it; goldens unchanged).
  • Linters that clash with deliberate design are scoped, not disabled, each with a reason: format self-registration in init(), the registry tables and sentinels (gochecknoglobals), interface seams (ireturn), CLI/ffprobe JSON names (tagliatelle), InPlacePatch's (nil, nil) "does not fit" (nilnil), parser byte offsets (mnd in the format packages), internal one-off errors (err113 outside the root package).

Code

  • Long parsers split without behavior change: FLAC Parse (readChain, addAudioTail), cue indices, vorbis.ParseChapters, the RF64 ds64 pieces, MP3 millisecond parsing, M4A covr edits, imagemeta.MIMEType.
  • ~700 tests and subtests now run in parallel. Tests that swap process-wide state (writer/parser/digester registries, the digester lookup, build metadata, the directory-sync hook, shared SafeReaders, allocation-measuring tests) stay serial, scoped by path with the reason.
  • Mechanical fixes: prealloc, usetesting, funcorder, thelper, errcheck, gocritic, revive, unparam, dupword and friends.

Verified: mise run ci (check, verify-mod, govulncheck, write gate with 120 s fuzz), GOARCH=386 go test ./..., GOOS=windows go vet ./..., and 30 shuffled race runs of the whole suite with no failure (one registry race found and fixed in the process).

For the maintainer to confirm: tests carry more relaxations than the four in the standard (mnd, funlen, err113, gosec G304): gosec G115/G204/G302/G404/G602/G703 in fixture builders, goconst and dupl off in tests, and nine large test functions keep a reasoned cyclop/gocognit nolint rather than being split. 39 nonamedreturns nolints share one generic reason.

# Conflicts:
#	internal/imagemeta/imagemeta.go
@simonhull
simonhull merged commit 40f8f0f into main Nov 12, 2026
6 checks passed
@simonhull
simonhull deleted the fix/round6-lint branch November 12, 2026 18:36
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