[sergo] Sergo Report: 32nd-Linter Reconcile + Fresh-Linter Audit - 2026-06-22 #40735
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-06-23T05:42:44.664Z.
|
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.
-
Executive Summary
Run R44 (44th cumulative). Strategy: strict 50/50 cached-reconcile + new-exploration. The cached half (
syntactic_stdlib_match) re-grepped all 32 analyzers and confirmed the five known stdlib-identity holdouts are still syntactic = unfixed (no new holdout surfaced). The new half audited the fresh, never-audited threshold/heuristic linters and found two real defects. 2 issues filed, both single-theme, non-duplicate.seenmapboolemits duplicate diagnostics for set-maps declared inside closures (double AST traversal).excessivefuncparams/largefunclack//nolintsuppression;excessivefuncparamsalso lints test files (the loneFuncDecllinter that does).Tool / Registry Updates
grep -c 'Analyzer')doc.goheaderThe
doc.godrift is the already-open #40436 — skipped, not refiled. The exact 32nd linter could not be identified under the shallow clone (single squashed commit, no per-file dates).Strategy Split
Cached half — syntactic_stdlib_match reconcile (proven, high-recency-stale)
Re-grepped
\.Name (==|!=) \"<pkg>\"acrosspkg/lintersusing both operators (linters use!=for early-return; an==-only grep misses holdouts). Result — all five known sites unchanged in code:osexitinlibrary.go:59fprintlnsprintf.go:144errstringmatch.go:100fileclosenotdeferred.go:172contextcancelnotdeferred.go:138All still match the stdlib package by identifier name (no
astutil.IsPkgSelector) → both issues remain unfixed and open. Separately,tolowerequalfoldhas been refactored to type-resolved alias collection (collectCaseConvAliases), withNodeTextnow used only for suggested-fix text — so #40580 is likely being addressed (flagged to recheck next run). No new holdout surfaced, so the cached half produced zero new issues — pure reconcile.New half — fresh-linter precision audit (underused targets)
Audited the heuristic/threshold and set-map linters never examined before. Findings:
seenmapbooldouble-report (filed): node filter registers{FuncDecl, FuncLit}andinspectBodyrecurses withast.Inspectinto nested closures — so a set-map declared in a closure is collected/reported once by the enclosing function's pass and again by the closure's own Preorder visit (2× normally, 3× if nested two deep).go/analysisdoes not de-dup by position.largefuncuses the same node filter but measures only each node's own span (no recursion) and is therefore correct — a clean contrast.internal/nolint;largefuncandexcessivefuncparamsdo not, so a legitimately-large function/wide signature cannot be suppressed at the call site (blocks CI enforcement).excessivefuncparamsadditionally omits thefilecheck.IsTestFileguard that every siblingFuncDecllinter applies.Audited clean (no issue):
errorfwrapv(type-awareIsFmtErrorf+types.Implements(errorIface)+ full format-verb/flag/width/explicit-index parsing;%wcorrectly skipped),ossetenvlibrary(fn.Pkg().Path()=="os"— type-resolved, the right way to do package identity),largefunc,deferinloop(cursorEnclosingwith correctFuncLitscope boundary).Generated Tasks (2)
seenmapbooldouble traversal — scope each map declaration to exactly one function scope (stopinspectBodyrecursion at nestedFuncLitboundaries while keeping the write-disqualification pass able to see closure writes, or de-dup reports by declaration position). Add a closure testdata case (current testdata has none). Effort: small.//nolint+ test-skip parity to threshold linters — wireinternal/nolintintolargefuncandexcessivefuncparams; addfilecheck.IsTestFiletoexcessivefuncparams. Prerequisite for promoting either to CI enforcement. Effort: small, follows 20 existing analyzers.Metrics
Historical Context
The stdlib-identity family (
syntactic_stdlib_match) has been the durable thread since R33: landed fixes (sortslice#38029,rawloginlib#39981,regexp#39733) plus open holdouts (#40243, #40435). Each new linter is probed for re-introducingident.Name==pkg; R44 found the newest fresh linters split —ossetenvlibrarydid package identity correctly (type-resolved), whilefileclose/contextcancel(R42) regressed it. R44 adds a new reusable pattern:double_traversal_dup— any linter combining a{FuncDecl, FuncLit}node filter with an innerast.Inspectrecursion risks duplicate diagnostics.Recommendations & Next-Run Focus (R45)
json.Unmarshal(data, &v)(ExprStmt) discards the error but is never inspected — only As [Content truncated due to length] #39982/sprintferrdot precision: verb handling {s,v} is wrong in both directions — %#v false positive, %q/%x/%X false negative #40434/lenstringzero coverage gap: len(s) != 0 is flagged but the identical idiom len(s) > 0 (and len(s) < 1 / <= 0) escapes — relation [Content truncated due to length] #40581/seenmapbool: duplicate diagnostics for set-maps declared inside function literals (double AST traversal) #40733-2.double_traversal_duponerrormessageand any other{FuncDecl, FuncLit}+ recursive-walk linter.References:
Beta Was this translation helpful? Give feedback.
All reactions