Skip to content

[Code Quality] Sync pkg/linters/doc.go count: add trimleftright bullet and add parity test #46644

Description

@github-actions

Description

pkg/linters/doc.go header and bullet list say 52 analyzers, but cmd/linters/main.go registers 53. The missing entry is trimleftright. This is a recurring drift class (previously fixed in #46131, #45185, #40436) that keeps reoccurring as new linters are added.

A count-parity test guard would prevent future drift.

Suggested Changes

  1. Add trimleftright bullet to pkg/linters/doc.go
  2. Bump the header count from 52 to 53
  3. Add a go test assertion that len(doc bullets) == len(registered analyzers) in cmd/linters/

Files Affected

  • pkg/linters/doc.go (header + bullet list)
  • cmd/linters/main.go:76-128 (registration)
  • New test file: cmd/linters/doc_parity_test.go (or similar)

Success Criteria

  • doc.go count matches registered count
  • trimleftright appears in the bullet list
  • A test fails if the counts diverge in future

Source

Extracted from Sergo Report #46528 (Finding 2, issue #46527)

Priority

Low — Documentation drift; trivial effort

🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · 40.8 AIC · ⌖ 6.1 AIC · ⊞ 7K ·

  • expires on Jul 20, 2026, 11:13 AM UTC-08:00

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions