Created
November 8, 2017 13:49
-
-
Save Ashaba/13398347d41bd11f1e9ff1733963f42b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias pythonfiles='find . -type f -name "*.py" | xargs git diff --cached --name-only $against' | |
if [ -n "$(pythonfiles)" ]; then | |
if pythonfiles | xargs grep --color --with-filename -n "import pdb"; then | |
echo "Error commiting changes: Please remove pdb and its usage" | |
exit 1 | |
fi | |
if pythonfiles | xargs grep --color --with-filename -n "pdb.set_trace()"; then | |
echo "Error commiting changes: Please remove pdb and its usage" | |
exit 1 | |
fi | |
if pythonfiles | xargs grep --color --with-filename -n "print"; then | |
echo "Error commiting changes: Please remove all print statements!" | |
exit 1 | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment