Skip to content

Instantly share code, notes, and snippets.

@arthuralvim
Created February 4, 2015 02:18
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 arthuralvim/871e6764e6aa14d79d32 to your computer and use it in GitHub Desktop.
Save arthuralvim/871e6764e6aa14d79d32 to your computer and use it in GitHub Desktop.
Git pre-commit hook to check if there's any debugger breakpoint inside your python files.
#!/bin/bash
pdb_check=$(git grep pdb -- '*.py')
if [ ${#pdb_check} -gt 0 ]
then
echo "COMMIT REJECTED: commit contains code with break points. Please remove before commiting."
echo $pdb_check
exit 1
else
echo "Code contains no break points"
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment