diff options
Diffstat (limited to 'pre-commit.sh')
-rwxr-xr-x | pre-commit.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pre-commit.sh b/pre-commit.sh new file mode 100755 index 0000000..3553140 --- /dev/null +++ b/pre-commit.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Pre-commit hook for ted development +# To install: +# ln -s ../../pre-commit.sh .git/hooks/pre-commit + +# Check for trailing whitespace +git grep -In ' $' && { echo 'Fix trailing whitespace!'; exit 1; } +git grep -In '\w'"$(printf '\t')"'$' && { echo 'Fix trailing whitespace!'; exit 1; } +exit 0 |