Context
golangci-lint v2.12.2 was run against this repository using the shared
configuration from the stack-go:lint skill. Nothing in the repository was
changed — this issue records the measurement and the work needed to adopt the
linter permanently.
The run covered the standard linter set only. The custom ruleguard rules were not
included, because they need files inside the repository; expect a few more
findings once they are in place.
Current state
| Metric |
Value |
| Go files, excluding vendor |
74 |
| Total findings |
229 |
| Correctness class |
87 |
| Style and convention class |
142 |
Most frequent: govet 57, tparallel 46, gocritic 25, paralleltest 24, errcheck 18
What to look at first
The densest correctness bucket in the sweep: 87 of 229 findings. govet
dominates with 57, mostly shadowed err declarations — cmd/yarddog/main.go:64
and :93 both shadow the declaration at line 52. errcheck adds 18.
errorlint reports 8 places formatting an error with %v where %w was
probably meant, which silently breaks errors.Is matching for every caller.
Adoption
- Copy
.golangci.yml from the stack-go:lint skill assets and fill in the two
blocks marked PROJECT: forbidden dependencies, and layer boundaries if this
repository has layers.
- Copy
gorules/rules.go and run go get github.com/quasilyte/go-ruleguard/dsl.
The file carries a //go:build ruleguard tag so it never enters a binary, but
the dependency must be present or the rules fail to typecheck.
- Copy
scripts/lint-checks.sh for the comment and test-scaffolding rules that
AST tooling cannot see.
- Wire
make lint to run golangci-lint run ./... followed by
scripts/lint-checks.sh.
- Add a CI job with the version pinned to
v2.12.2. An unpinned linter turns
someone else's release into a red build on an untouched branch.
- Adopt a baseline. With 229 standing findings, a blocking gate on day one
is a gate that gets switched off in a week. Use --new-from-rev so only new
code is checked, then clear the backlog by class in separate commits.
Not covered by the linter
These stay manual review items and are documented in the stack-go:lint skill:
- A
jackc/pgx repository layer gets no SQL coverage at all — rowserrcheck and
sqlclosecheck understand database/sql only.
- Goroutine ownership: who waits for it, how it is told to stop, where its error
goes.
- Whether fan-out is bounded, and whether a channel buffer size has a stated
reason.
- Placement of code by actual consumption, and whether two similar blocks share
an invariant or merely look alike.
Context
golangci-lintv2.12.2 was run against this repository using the sharedconfiguration from the
stack-go:lintskill. Nothing in the repository waschanged — this issue records the measurement and the work needed to adopt the
linter permanently.
The run covered the standard linter set only. The custom ruleguard rules were not
included, because they need files inside the repository; expect a few more
findings once they are in place.
Current state
Most frequent:
govet57,tparallel46,gocritic25,paralleltest24,errcheck18What to look at first
The densest correctness bucket in the sweep: 87 of 229 findings.
govetdominates with 57, mostly shadowed
errdeclarations —cmd/yarddog/main.go:64and
:93both shadow the declaration at line 52.errcheckadds 18.errorlintreports 8 places formatting an error with%vwhere%wwasprobably meant, which silently breaks
errors.Ismatching for every caller.Adoption
.golangci.ymlfrom thestack-go:lintskill assets and fill in the twoblocks marked
PROJECT: forbidden dependencies, and layer boundaries if thisrepository has layers.
gorules/rules.goand rungo get github.com/quasilyte/go-ruleguard/dsl.The file carries a
//go:build ruleguardtag so it never enters a binary, butthe dependency must be present or the rules fail to typecheck.
scripts/lint-checks.shfor the comment and test-scaffolding rules thatAST tooling cannot see.
make lintto rungolangci-lint run ./...followed byscripts/lint-checks.sh.v2.12.2. An unpinned linter turnssomeone else's release into a red build on an untouched branch.
is a gate that gets switched off in a week. Use
--new-from-revso only newcode is checked, then clear the backlog by class in separate commits.
Not covered by the linter
These stay manual review items and are documented in the
stack-go:lintskill:jackc/pgxrepository layer gets no SQL coverage at all —rowserrcheckandsqlclosecheckunderstanddatabase/sqlonly.goes.
reason.
an invariant or merely look alike.