You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keep Untracked Files Out of the Pre-Commit Snippet's Prose Gate #3370
The prose-gate entry in catalog/snippets/pre-commit/.pre-commit-config.yaml runs the gate over . with --diff HEAD. pre-commit sets aside unstaged changes to tracked files before running a hook, but it leaves untracked files in place, and the gate's discovery includes them. So an untracked file holding a violation fails a commit that does not include it.
Reproduce in any repository carrying the snippet, with the hook config committed:
printf'# Scratch\n\nThis line has a semicolon; it should trip the gate.\n'> untracked-bad.md
printf'# Clean\n\nA clean line.\n'> staged-clean.md
git add staged-clean.md
pre-commit run
The prose gate fails on untracked-bad.md:3: semicolon, a file the commit does not carry. This was reproduced on ptr727/ESPHome-NonRoot#349, raised there by CodeRabbit.
GOVERNANCE.md "Running the Linters Locally" says the pre-commit scope "is the staged state instead", which is true for tracked files and not for untracked ones.
A likely fix: drop pass_filenames: false from the entry so pre-commit passes the staged paths, and take . out of the entry so those paths are the gate's paths argument, keeping --diff HEAD. Check that the gate still finds a violation on a staged line, and that the GOVERNANCE.md sentence matches what the snippet then does. The Husky.Net snippet and the hub's own .husky/pre-commit judge the working tree by design, so whether an untracked file is in scope there is a separate question.
Done means the repro above passes with the snippet, and a staged violation still fails.
Activity
Keep Untracked Files Out of the Pre-Commit Snippet's Prose Gate (#3444)
Promote the pr_review.py Leaf-Module Split, the Held-Wait Run Hold, a…