Add TODO check to pre-commit-hook

main
Chandler Swift 2024-08-03 23:28:27 -05:00
parent bce4a9b318
commit a3cf49de01
Signed by: chandlerswift
GPG Key ID: A851D929D52FB93F
1 changed files with 8 additions and 0 deletions

View File

@ -6,6 +6,14 @@ else
against=$(git hash-object -t tree /dev/null) against=$(git hash-object -t tree /dev/null)
fi fi
# https://stackoverflow.com/a/7292992
. git-sh-setup # for die
if git-diff-index -p -M --cached $against -- \
| grep '^+' \
| grep TODO; then
die Blocking commit because string TODO detected in patch
fi
# If you want to allow non-ASCII filenames set this variable to true. # If you want to allow non-ASCII filenames set this variable to true.
allownonascii=$(git config --type=bool hooks.allownonascii) allownonascii=$(git config --type=bool hooks.allownonascii)