Skip to content

Instantly share code, notes, and snippets.

@ricardosiri68
Forked from milancermak/pre-commit.sh
Last active November 17, 2015 23:42
Show Gist options
  • Save ricardosiri68/109a564d2c4f5aa04d57 to your computer and use it in GitHub Desktop.
Save ricardosiri68/109a564d2c4f5aa04d57 to your computer and use it in GitHub Desktop.
Python pre-commit hook
#!/bin/sh
# make sure requirements.txt is up to date with every commit
# by comparing the output of pip freeze
source [virtualenv_path]/bin/activate
pip freeze | diff requirements.txt - > /dev/null
if [ $? != 0 ]
then
echo "Missing python module dependencies in requirements.txt. Run 'pip freeze > requirements.txt' to update."
deactivate
exit 1
fi
# quite la parte que checkeaba los modulos con pyflakes
# y que revisaba que no se nos olvidaba un set_trace() en en el codigo
deactivate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment