Skip to content

Instantly share code, notes, and snippets.

@wo0dyn
Created March 8, 2013 10:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wo0dyn/5115486 to your computer and use it in GitHub Desktop.
Save wo0dyn/5115486 to your computer and use it in GitHub Desktop.
# make sure there's no TODO, debugging... left
errors=0
for bad in 'import pdb' 'import ipdb' 'TODO' 'print' 'assert False'; do
echo ">> checking for '$bad'"
res=$(git diff-index --name-only --cached $against -S"$bad" --)
if test -n "$res"; then # if not empty, found some guilty files
echo "ERROR, found '$bad' in files commited:"
echo $res
errors=$(($errors + 1))
fi
done
exit $errors # if errors, return an error: commit aborted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment