Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# How to use this script:
# $ git config --global init.templatedir '~/.git-templates'
# $ mkdir -p ~/.git-templates/hooks
# save this file as pre-commit
# $ chmod +x ~/.git-templates/hooks/pre-commit
RED=`tput setaf 1`
GREEN=`tput setaf 2`
RESET=`tput sgr0`
FILES=`find . -iname '*.py'`
for file in $FILES; do
if egrep -A1 -i '#\s*todo|debug|dbg' $file | grep -q 'print'; then
printf "remove ${RED}debug print${RESET} or run ${GREEN}git commit --no-verify${RESET}\n"
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.