Repository navigation
Description
Summary
The new lenstringzero analyzer (ADR-37618, flags len(s) == 0 / len(s) != 0 on string values) was added to the live analyzer driver but the documentation and spec-test surface were not updated alongside it. The driver now runs 22 analyzers while every documentation/spec artifact still says 21, so the new linter is invisible to the README, the package doc, and — critically — has no spec-test coverage.
- Driver analyzer count (
cmd/linters/main.go): 22 ✅ (includeslenstringzero) pkg/linters/doc.go: 21 ❌pkg/linters/README.md: 21 ❌ (missing from bullet list, table, and import list)pkg/linters/spec_test.godocumentedAnalyzers(): 21 ❌ (does not validatelenstringzero.Analyzer)- Status:
⚠️ self-consistency gap
Evidence
lenstringzero is imported and registered in the multichecker:
cmd/linters/main.go:29—"github.com/github/gh-aw/pkg/linters/lenstringzero"cmd/linters/main.go:64—lenstringzero.Analyzer,
But it is absent everywhere the linter set is documented/asserted:
Per-artifact breakdown
pkg/linters/doc.go
Line 3 states // The actual analyzers are implemented in subpackages. All 21 active analyzers: followed by a 21-item bullet list that does not include lenstringzero.
pkg/linters/README.md
lenstringzero does not appear anywhere (grep → not found). The three places that enumerate analyzers all stop at 21:
- the
Subpackagesbullet list (~line 28, ends attolowerequalfold/uncheckedtypeassertion) - the
Public API > Subpackagestable (~line 57) - the import list (~line 122)
pkg/linters/spec_test.go
documentedAnalyzers() (lines 62–86) returns 21 entries and the doc comment (lines 49–61) explicitly says "The README documents 21 analyzer subpackages". Because TestSpec_PublicAPI_SubpackageAnalyzers, TestSpec_UsageExample_AnalyzersUsable, and TestSpec_DesignDecision_UniqueAnalyzerNames all iterate over this list, none of them exercise lenstringzero.Analyzer — its Name/Run wiring and name-uniqueness are currently unverified by the spec suite.
Impact
- The newest linter has zero spec-test coverage: a regression that nil'd
lenstringzero.Analyzer, dropped itsRun, or collided itsNamewith another analyzer would not be caught byspec_test.go. - Contributors reading
doc.go/README.mdcannot discover the linter or its rule, and the documented count ("All 21") is now stale/incorrect. - Breaks the established one-package-per-linter self-consistency invariant that prior Sergo runs have relied on (every shipped analyzer is documented + spec-tested).
Recommendation
Sync all three artifacts to 22 analyzers, matching the pattern used for the previous additions:
pkg/linters/doc.go— changeAll 21 active analyzers→All 22 active analyzersand add the bullet:
// - lenstringzero — flags len(s) == 0 / len(s) != 0 on string values that should use s == \"\" / s != \"\"pkg/linters/README.md— addlenstringzeroto the Subpackages bullet list, the Public API table row, and the import list (alphabetical position: afterlargefunc, beforemanualmutexunlock).pkg/linters/spec_test.go— add the import and the{\"lenstringzero\", lenstringzero.Analyzer}entry todocumentedAnalyzers(), and update the count/comment from 21 → 22 (lines 49–61).
Validation checklist
-
go test ./pkg/linters/...passes withlenstringzeroadded todocumentedAnalyzers() -
grep -cof analyzer rows in README equals the count incmd/linters/main.go -
doc.gocount and bullet list both read 22 -
TestSpec_PublicAPI_SubpackageAnalyzers/lenstringzerosubtest runs and passes
Effort: Low (documentation + one test-table entry; no analyzer logic changes).
References
- ADR:
docs/adr/37618-add-lenstringzero-linter.md - Driver:
cmd/linters/main.go:29,cmd/linters/main.go:64
Generated by 🤖 Sergo - Serena Go Expert · 236 AIC · ⌖ 15.2 AIC · ⊞ 6.5K · ◷
- expires on Jun 14, 2026, 9:25 PM UTC-08:00
Activity