Problem
scripts/pre-commit-hooks/golangci-lint-fast.sh runs git add -u -- "$module/*.go" as an auto-restage step. This indiscriminately restages every modified .go file in the module, regardless of what's actually staged/pathspec-limited for the commit in progress — even for a pathspec-limited git commit -- <files> call.
Impact
Surfaced during the flaky-SQLite-test-cleanup fix (development commits 5e38d2c5..b9a46963): with 17 test files modified at once across a multi-commit PR, the first two narrow git commit -- <specific files> attempts accidentally swept in all 17 files because this hook silently re-added everything in the module. Required a git stash push -- <other files> / git stash pop workaround around each commit to keep commits scoped as intended.
This will bite anyone doing deliberately-sliced, multi-commit PRs (which CLAUDE.md's Commit Slicing Strategy explicitly asks for) whenever more than one file in a module is dirty at once.
Suggested fix
Scope the git add -u to the same pathspec the commit itself is using, or drop the auto-restage behavior in favor of linting only what's already staged.
Priority
Low-risk, dev-workflow-only — no runtime/production impact. Good candidate for next week's fix cycle.
Problem
scripts/pre-commit-hooks/golangci-lint-fast.shrunsgit add -u -- "$module/*.go"as an auto-restage step. This indiscriminately restages every modified.gofile in the module, regardless of what's actually staged/pathspec-limited for the commit in progress — even for a pathspec-limitedgit commit -- <files>call.Impact
Surfaced during the flaky-SQLite-test-cleanup fix (
developmentcommits5e38d2c5..b9a46963): with 17 test files modified at once across a multi-commit PR, the first two narrowgit commit -- <specific files>attempts accidentally swept in all 17 files because this hook silently re-added everything in the module. Required agit stash push -- <other files>/git stash popworkaround around each commit to keep commits scoped as intended.This will bite anyone doing deliberately-sliced, multi-commit PRs (which CLAUDE.md's Commit Slicing Strategy explicitly asks for) whenever more than one file in a module is dirty at once.
Suggested fix
Scope the
git add -uto the same pathspec the commit itself is using, or drop the auto-restage behavior in favor of linting only what's already staged.Priority
Low-risk, dev-workflow-only — no runtime/production impact. Good candidate for next week's fix cycle.