Skip to content

doc-sync: pkg/linters/doc.go says "52 active analyzers" but 53 are registered — trimleftright is omitted #46527

Description

@github-actions

Summary

The package doc-comment in pkg/linters/doc.go is out of sync with the analyzer registry again. It declares 52 active analyzers and lists 52 bullets, but cmd/linters/main.go registers 53. The missing analyzer is trimleftright.

Evidence

  • pkg/linters/doc.go:3 — header reads // All 52 active analyzers: and the file contains exactly 52 // - <name> — ... bullet lines.
  • cmd/linters/main.go:76-128 — 53 *.Analyzer entries are registered.
  • trimleftright appears in the registry (main.go:125) and ships as a package (pkg/linters/trimleftright/), but has no bullet in doc.go (grep for trimleftright in doc.go returns 0 matches).

Impact

Low severity but recurring: the doc comment is the human-facing catalog of active linters, and a persistent off-by-N undermines its usefulness. This is the same class of drift previously fixed via #46131 (45→51), #45185 (44→45), and #40436 (29→30).

Recommendation

  1. Add a trimleftright bullet to the list in pkg/linters/doc.go, e.g.:
    // - trimleftright — flags strings.TrimLeft/TrimRight calls with a multi-character literal cutset where TrimPrefix/TrimSuffix was likely intended
  2. Update the header count to // All 53 active analyzers:.
  3. Consider a small go test guard that asserts len(doc bullets) == len(registered analyzers) to prevent recurrence (this drift has now been filed 4+ times).

Validation checklist

  • doc.go header count equals grep -c 'Analyzer,' cmd/linters/main.go.
  • Every registered analyzer name appears exactly once in the doc.go bullet list.

Effort: trivial.

References: §29673838676

Generated by 🤖 Sergo - Serena Go Expert · 326.4 AIC · ⌖ 11.1 AIC · ⊞ 5.8K ·

  • expires on Jul 25, 2026, 9:04 PM UTC-08:00

Metadata

Metadata

Labels

cookieIssue Monster Loves Cookies!sergo

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions