Description
The custom-linter registry (55 analyzers in cmd/linters/main.go) has drifted from pkg/linters/doc.go (54) and pkg/linters/README.md (54) repeatedly. The existing tests only compare surfaces against each other — never against the authoritative registry — so they always pass even when drift occurs. Root cause: multichecker.Main(...) is in package main and is unimportable, so nothing can enumerate it.
Suggested Changes
- Add a test in
pkg/linters/spec_test.go (or a new registry_test.go) that parses cmd/linters/main.go via go/ast or a simple regex to count/enumerate registered analyzers.
- Compare the parsed count/list against
doc.go bullet count and README.md table rows.
- Fail with a descriptive message listing the missing entries when any surface is out of sync.
- Update
doc.go and README.md to add sprintfbool (the 55th linter currently missing).
Files Affected
pkg/linters/spec_test.go (or new pkg/linters/registry_sync_test.go)
pkg/linters/doc.go — add sprintfbool entry
pkg/linters/README.md — add sprintfbool row
Success Criteria
- New test fails when a new analyzer is added to
cmd/linters/main.go without updating docs
sprintfbool is documented in both doc.go and README.md
- All existing tests pass
Source
Extracted from Sergo Report: Registry Catch-up + Doc-Sync Root-Cause - 2026-07-21 #46979
See also existing tracking issue #46977.
Priority
Medium — doc drift keeps recurring; a test guard will prevent future regressions
🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · 39.1 AIC · ⌖ 5.29 AIC · ⊞ 7K · ◷
Description
The custom-linter registry (55 analyzers in
cmd/linters/main.go) has drifted frompkg/linters/doc.go(54) andpkg/linters/README.md(54) repeatedly. The existing tests only compare surfaces against each other — never against the authoritative registry — so they always pass even when drift occurs. Root cause:multichecker.Main(...)is in packagemainand is unimportable, so nothing can enumerate it.Suggested Changes
pkg/linters/spec_test.go(or a newregistry_test.go) that parsescmd/linters/main.goviago/astor a simple regex to count/enumerate registered analyzers.doc.gobullet count andREADME.mdtable rows.doc.goandREADME.mdto addsprintfbool(the 55th linter currently missing).Files Affected
pkg/linters/spec_test.go(or newpkg/linters/registry_sync_test.go)pkg/linters/doc.go— addsprintfboolentrypkg/linters/README.md— addsprintfboolrowSuccess Criteria
cmd/linters/main.gowithout updating docssprintfboolis documented in bothdoc.goandREADME.mdSource
Extracted from Sergo Report: Registry Catch-up + Doc-Sync Root-Cause - 2026-07-21 #46979
See also existing tracking issue #46977.
Priority
Medium — doc drift keeps recurring; a test guard will prevent future regressions