Browse Source
Add a shared Git hook to reject trailing whitespace in staged changes. Document how developers enable the hook locally. Keep the GitHub Actions check as a server-side safeguard for pull requests. Signed-off-by: Robin Getz <rgetz503@gmail.com>chirpmodem-v8.0.0
2 changed files with 28 additions and 0 deletions
@ -0,0 +1,8 @@ |
|||||||
|
#!/bin/sh |
||||||
|
|
||||||
|
#fail if trailing spaces |
||||||
|
if ! git diff --cached --check -- \ |
||||||
|
':(attr:text)' ':(attr:text=auto)'; then |
||||||
|
echo "Error: Remove trailing whitespace from staged changes." |
||||||
|
exit 1 |
||||||
|
fi |
||||||
Loading…
Reference in new issue