From 05a0354c85e1fa842a999594141ca266e457481b Mon Sep 17 00:00:00 2001 From: Alex Dunmow Date: Sat, 4 Jul 2026 01:30:52 +0800 Subject: [PATCH] style: normalize any check finding lines to canonical file:line format Drop the stray em-dash (envreads) and arrow (reinvented) separators so all findings use the two canonical shapes: "file:line snippet" and "file:line [rule] detail". Co-Authored-By: Claude Opus 4.8 --- check_envreads.go | 2 +- check_reinvented.go | 2 +- testdata/golden/nomod/expected.stdout | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/check_envreads.go b/check_envreads.go index ea51464..456ac5a 100644 --- a/check_envreads.go +++ b/check_envreads.go @@ -22,7 +22,7 @@ func init() { if len(envViolations) > 0 { rep.Fail("%d secret env var read(s) outside config.Load() — secrets must flow through Config → DI", len(envViolations)) for _, v := range envViolations { - rep.Findingf("%s:%d — os.Getenv(%q)", v.file, v.line, v.envVar) + rep.Findingf("%s:%d os.Getenv(%q)", v.file, v.line, v.envVar) } } else { if len(ctx.pluginTargets) > 0 { diff --git a/check_reinvented.go b/check_reinvented.go index fb478e9..467f1aa 100644 --- a/check_reinvented.go +++ b/check_reinvented.go @@ -30,7 +30,7 @@ func init() { if len(allReinvented) > 0 { rep.Fail("%d reinvented utility pattern(s)", len(allReinvented)) for _, v := range allReinvented { - rep.Findingf("%s:%d [%s] → %s", v.file, v.line, v.rule, v.hint) + rep.Findingf("%s:%d [%s] %s", v.file, v.line, v.rule, v.hint) } } else { rep.OK("No reinvented utilities detected") diff --git a/testdata/golden/nomod/expected.stdout b/testdata/golden/nomod/expected.stdout index e3d38dc..58caba7 100644 --- a/testdata/golden/nomod/expected.stdout +++ b/testdata/golden/nomod/expected.stdout @@ -1,6 +1,6 @@ check-safety FIXTURE_DIR FAIL 1 1 secret env var read(s) outside config.Load() — secrets must flow through Config → DI - internal/service/handler.go:17 — os.Getenv("JWT_SECRET") + internal/service/handler.go:17 os.Getenv("JWT_SECRET") FAIL 2c 1 CMS backend go.mod violation(s) FIXTURE_DIR/go.mod [missing-go-mod] missing go.mod FAIL 14 1 raw SQL statement(s) found outside sqlc/Bob