Summary
Two new analyzers landed since the last doc sync — hardcodedfilepath (#38742) and timesleepnocontext (#38704) — but the package-level documentation and the spec test were not fully updated. The three sources of truth now disagree:
| Source |
Count |
Missing |
cmd/linters/main.go (multichecker.Main) |
26 |
— (canonical) |
pkg/linters/README.md + pkg/linters/spec_test.go documentedAnalyzers() |
25 |
timesleepnocontext |
pkg/linters/doc.go |
24 |
hardcodedfilepath and timesleepnocontext |
This is the recurring new_linter_doc_lag pattern (previously fixed by #37740 lenstringzero, #38028 sortslice).
Evidence
cmd/linters/main.go:48-75 registers 26 analyzers, including hardcodedfilepath.Analyzer (line 58) and timesleepnocontext.Analyzer (line 72).
pkg/linters/doc.go:3 reads // The actual analyzers are implemented in subpackages. All 24 active analyzers: and the bullet list below it has exactly 24 entries — neither hardcodedfilepath nor timesleepnocontext appears.
pkg/linters/spec_test.go:54-65 documents "25 analyzer subpackages" and documentedAnalyzers() (lines 66-94) returns 25 entries: it includes hardcodedfilepath (line 77) but omits timesleepnocontext.
pkg/linters/README.md documents hardcodedfilepath (lines 18, 51, 85, 104, 128) but has no timesleepnocontext entry.
Impact
doc.go understates the analyzer set by 2, so the package godoc is wrong for two shipped linters.
timesleepnocontext is invisible to the README "Subpackages" table and is not covered by TestSpec_PublicAPI_SubpackageAnalyzers / TestSpec_UsageExample_AnalyzersUsable, so its Analyzer wiring is unverified by the spec suite even though it ships in the driver.
Recommendation
pkg/linters/doc.go: change All 24 active analyzers → All 26 active analyzers and add bullets for hardcodedfilepath and timesleepnocontext (alphabetical order), mirroring the existing one-line descriptions from each analyzer's Doc string.
pkg/linters/spec_test.go: bump the "25" comment to "26", add {"timesleepnocontext", timesleepnocontext.Analyzer} to documentedAnalyzers(), and add the import. Update the Spec comment list (lines 60-65).
pkg/linters/README.md: add timesleepnocontext to the Subpackages bullet list, the table, the usage-example block, and the import-list, matching how hardcodedfilepath was added.
Validation checklist
Effort: Small — docs/test only, no analyzer logic change.
References
Generated by 🤖 Sergo - Serena Go Expert · 290.8 AIC · ⌖ 12.6 AIC · ⊞ 6.3K · ◷
Summary
Two new analyzers landed since the last doc sync —
hardcodedfilepath(#38742) andtimesleepnocontext(#38704) — but the package-level documentation and the spec test were not fully updated. The three sources of truth now disagree:cmd/linters/main.go(multichecker.Main)pkg/linters/README.md+pkg/linters/spec_test.godocumentedAnalyzers()timesleepnocontextpkg/linters/doc.gohardcodedfilepathandtimesleepnocontextThis is the recurring
new_linter_doc_lagpattern (previously fixed by #37740 lenstringzero, #38028 sortslice).Evidence
cmd/linters/main.go:48-75registers 26 analyzers, includinghardcodedfilepath.Analyzer(line 58) andtimesleepnocontext.Analyzer(line 72).pkg/linters/doc.go:3reads// The actual analyzers are implemented in subpackages. All 24 active analyzers:and the bullet list below it has exactly 24 entries — neitherhardcodedfilepathnortimesleepnocontextappears.pkg/linters/spec_test.go:54-65documents "25 analyzer subpackages" anddocumentedAnalyzers()(lines 66-94) returns 25 entries: it includeshardcodedfilepath(line 77) but omitstimesleepnocontext.pkg/linters/README.mddocumentshardcodedfilepath(lines 18, 51, 85, 104, 128) but has notimesleepnocontextentry.Impact
doc.gounderstates the analyzer set by 2, so the package godoc is wrong for two shipped linters.timesleepnocontextis invisible to the README "Subpackages" table and is not covered byTestSpec_PublicAPI_SubpackageAnalyzers/TestSpec_UsageExample_AnalyzersUsable, so itsAnalyzerwiring is unverified by the spec suite even though it ships in the driver.Recommendation
pkg/linters/doc.go: changeAll 24 active analyzers→All 26 active analyzersand add bullets forhardcodedfilepathandtimesleepnocontext(alphabetical order), mirroring the existing one-line descriptions from each analyzer'sDocstring.pkg/linters/spec_test.go: bump the "25" comment to "26", add{"timesleepnocontext", timesleepnocontext.Analyzer}todocumentedAnalyzers(), and add the import. Update the Spec comment list (lines 60-65).pkg/linters/README.md: addtimesleepnocontextto the Subpackages bullet list, the table, the usage-example block, and the import-list, matching howhardcodedfilepathwas added.Validation checklist
grep -c '^// - ' pkg/linters/doc.goreturns 26 and the header says "All 26".len(documentedAnalyzers())== number of analyzers incmd/linters/main.go(26).go test ./pkg/linters/...passes (spec tests now cover both new linters).Effort: Small — docs/test only, no analyzer logic change.
References