development: keep ignored scratch experiments out of ./... package discovery #14
Labels
No labels
nagonag
nagonag/ignore
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
heiko/mailseal#14
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The repository intentionally ignores
/scratch/and excludes it from golangci-lint, but an ignoredscratch/main.gounder the module root is still discovered bygo test ./...andstaticcheck ./.... In the reviewed working tree, Staticcheck reportsS1023(redundant return) there even though golangci-lint reports zero issues.This makes whole-module validation dependent on untracked local experiments and can produce different results for different developers.
Checklist: #2 (remove redundant/dead code) and #12 (keep experimental code outside production package discovery).
Proposed fix
Choose and document one policy:
_or.so Go's./...discovery ignores it; orexamples/package and hold them to normal checks.Merely adding the path to
.gitignoreor golangci exclusions does not affectgo test ./...or standalone Staticcheck.Acceptance criteria
go list ./....go test ./...,go vet ./..., Staticcheck, and golangci-lint inspect the same intended project packages.Reviewed against
948b7a9onmaster(Go 1.26.2).The hidden scratch policy is documented and package-discovery behavior has functional regression coverage.
Closing commit:
220883620b7b