You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pkg/linters/doc.go has drifted out of sync with the analyzer registry in cmd/linters/main.go. The doc header reads // All 45 active analyzers: and lists 45 bullets, but 51 analyzers are actually registered — a drift of 6.
This is the same doc-sync class fixed before (#40436, #45185); the list has simply fallen behind again as 6 new linters landed without doc updates.
Documented: pkg/linters/doc.go:3 header // All 45 active analyzers: + 45 // - <name> bullets.
The 6 omitted analyzers (registered but absent from doc.go bullets)
bytesbufferstring
ioutildeprecated
logfatallibrary
mapclearloop
mapdeletecheck
stringscountcontains
These are exactly the 6 newest linters.
Impact
The package doc is the canonical human-facing inventory of the custom linters; a 6-analyzer undercount plus a wrong header count misleads contributors about what coverage exists and which linters to reference for //nolint directives.
Low runtime risk, but it recurs every few linters and has previously been treated as worth fixing.
Recommendation
Update the header to // All 51 active analyzers:.
Add the 6 missing bullets (alphabetical, matching the existing one-line name — description style; descriptions can be lifted from each analyzer's Doc field).
Summary
pkg/linters/doc.gohas drifted out of sync with the analyzer registry incmd/linters/main.go. The doc header reads// All 45 active analyzers:and lists 45 bullets, but 51 analyzers are actually registered — a drift of 6.This is the same doc-sync class fixed before (
#40436,#45185); the list has simply fallen behind again as 6 new linters landed without doc updates.Evidence
cmd/linters/main.go:74-124→ 51*.Analyzer,entries.pkg/linters/doc.go:3header// All 45 active analyzers:+ 45// - <name>bullets.The 6 omitted analyzers (registered but absent from doc.go bullets)
bytesbufferstringioutildeprecatedlogfatallibrarymapclearloopmapdeletecheckstringscountcontainsThese are exactly the 6 newest linters.
Impact
//nolintdirectives.Recommendation
// All 51 active analyzers:.name — descriptionstyle; descriptions can be lifted from each analyzer'sDocfield).len(registered analyzers) == number of doc.go bullets == header count, so this cannot silently drift again (the recurrence — doc-sync: pkg/linters/doc.go says "29 active analyzers" but 30 are registered — list omits hardcodedfilepath and sprintferrdot #40436, doc-sync: pkg/linters/doc.go says "44 active analyzers" but 45 are registered — the list omits stringscountcontains #45185, now this — argues for automating it).Validation checklist
grep -c 'Analyzer,' cmd/linters/main.go(51).pkg/lintersfails if the counts diverge.Effort: trivial (doc-only), plus optional small guard test.