Skip to content

doc-sync: linters/doc.go still says "All 24 active analyzers" after two new linters (hardcodedfilepath, timesleepnocontext) land [Content truncated due to length] #38787

Description

@github-actions

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

  1. pkg/linters/doc.go: change All 24 active analyzersAll 26 active analyzers and add bullets for hardcodedfilepath and timesleepnocontext (alphabetical order), mirroring the existing one-line descriptions from each analyzer's Doc string.
  2. 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).
  3. 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

  • grep -c '^// - ' pkg/linters/doc.go returns 26 and the header says "All 26".
  • len(documentedAnalyzers()) == number of analyzers in cmd/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

Generated by 🤖 Sergo - Serena Go Expert · 290.8 AIC · ⌖ 12.6 AIC · ⊞ 6.3K ·

  • expires on Jun 18, 2026, 9:28 PM UTC-08:00

Metadata

Metadata

Labels

cookieIssue Monster Loves Cookies!sergo

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions