[sergo] Sergo Report: Tool-Change Detect 23rd Linter (sortslice) — Doc-Sync + Package-Identity Precision — 2026-06-09 #38030
Closed
Replies: 1 comment
-
|
This discussion has been marked as outdated by Sergo - Serena Go Expert. A newer discussion is available at Discussion #38283. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Run R31 detected a linter-registry tool change — a 23rd custom analyzer,
sortslice, has landed in the driver — and applied the proven two-pronged template to it: a self-consistency doc-sync finding and a package-identity precision finding. Last run's two issues (#37740, #37741) both landed and closed within a day, confirming thenew_linter_doc_lagand single-file-precision fast-land patterns. Two new, non-duplicate issues were filed.sg31a1,sg31a2)Critical Findings
🆕 sg31a1 —
sortslice(23rd linter) registered but undocumented.cmd/linters/main.go:37,63wiressortslice.Analyzer, butdoc.gostill says "All 22 active analyzers",README.mdhas zerosortslicereferences, andspec_test.godocumentedAnalyzers()lists only 22 — soTestSpec_PublicAPI_SubpackageAnalyzersdoes not validate the 23rd analyzer. Identical to the just-landedlenstringzerogap (#37740). → Issue filed.🆕 sg31a2 —
sortslicematches by syntactic name, not package identity.sortslice.go:54-57gates onpkgIdent.Name == "sort"with nopass.TypesInfocheck. It is the only package-matching custom linter that skips type verification, yielding a false positive on any shadowing identifier namedsortand a false negative on stdlibsortimported under an alias. Fix = mirrorfmterrorfnoverbs.isFmtErrorf(ObjectOf → *types.PkgName → Imported().Path() == "sort"). → Issue filed.Strategy: 50 / 50 Split
Cached reuse (50%) — tool-change detection + reverify-prior-landed
cmd/linters/main.goanalyzer count (23) againstdoc.go("All 22") andspec_test.godocumentedAnalyzers()(22) → surfaced the 23rd-linter doc-lag, the same template that landedsg30a1in one day.gh api .../issues?labels=sergo&state=all: lenstringzero (22nd custom linter) is registered in the driver but undocumented — sync doc.go, README, and spec_test to 22 analy [Content truncated due to length] #37740 (lenstringzero doc-sync) and lenstringzero precision: flag len() stored in an intermediate variable (n := len(s); n == 0) using the alias-tracking pattern th [Content truncated due to length] #37741 (intermediate-var FN) both closed.lenstringzeronow appears indoc.go,README.md(5 entries), andspec_test.go.New exploration (50%) — package-identity precision audit of the newcomer
search_for_patternforTypesInfo|PkgPathacrosspkg/lintersto map how each analyzer resolves stdlib-package calls. Result:fmterrorfnoverbs,jsonmarshalignoredeerror,strconvparseignorederror,ossetenvlibrary(and others) all resolve viapass.TypesInfo;sortslicealone matches on the spelled identifier → precision findingsg31a2.gh search issues):lint-monsteralready owns the 50+ call-site migration ([lint-monster] Sort Type-Safety: Migrate from sort.Slice to slices.SortFunc #38012, [lint-monster] Migrate unsafe sort.Slice calls to type-safe slices.SortFunc #38014), so sergo deliberately scoped to doc-sync + analyzer correctness — orthogonal, non-duplicate.Evidence Snapshot
Registry vs documentation (23 vs 22)
cmd/linters/main.goimports + registrationssortsliceL37/L63)doc.goheader + bulletssortslice)README.mdsortslicereferencesspec_test.godocumentedAnalyzers()cgo.yml:1119LINTER_FLAGS)Precision: sibling linters vs sortslice
FP:
sort := newSorter(); sort.Slice(...)wrongly flagged. FN:import s "sort"; s.Slice(...)silently missed. Testdata also lacks alias / shadowing / nolint cases.Generated Tasks
doc.go/README.md/spec_test.goto 23 analyzers (mirrorlenstringzerolenstringzero (22nd custom linter) is registered in the driver but undocumented — sync doc.go, README, and spec_test to 22 analy [Content truncated due to length] #37740). Small effort, docs-only.sortslicepackage viapass.TypesInfo.ObjectOf(...).(*types.PkgName).Imported().Path() == "sort"+ add alias/shadowing testdata. Small effort, single-file precision.Historical Context
new_linter_doc_lagnow confirmed twice (lenstringzero R30→landed R31; sortslice R31) — each new linter lands in the driver before docs/spec sync.seenmapbool60+,sortslice50+ sites) do not auto-land via sergo and are deferred to migration owners.Recommendations / Next-Run Focus (R32)
sg31a1(doc-sync) andsg31a2(type-identity) landed.new_linter_precision_audit(TypesInfo check) to any newcomer.sortsliceCI enforcement, which should auto-follow thelint-monstermigration ([lint-monster] Sort Type-Safety: Migrate from sort.Slice to slices.SortFunc #38012/[lint-monster] Migrate unsafe sort.Slice calls to type-safe slices.SortFunc #38014); revisitlenstringzeroenforce-roadmap.References:
Beta Was this translation helpful? Give feedback.
All reactions