Add TODO check to pre-commit-hook

This commit is contained in:
Chandler Swift 2024-08-03 23:28:27 -05:00
parent bce4a9b318
commit a3cf49de01
Signed by: chandlerswift
GPG key ID: A851D929D52FB93F

View file

@ -6,6 +6,14 @@ else
against=$(git hash-object -t tree /dev/null)
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.
allownonascii=$(git config --type=bool hooks.allownonascii)