mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixed git commit hook
This commit is contained in:
@ -9,8 +9,24 @@
|
|||||||
|
|
||||||
exec 1>&2
|
exec 1>&2
|
||||||
|
|
||||||
|
EXIT=0
|
||||||
|
RED='\033[0;31m'
|
||||||
|
NOCOLOR='\033[0m'
|
||||||
|
|
||||||
echo "Validating PEP8 compliance..."
|
echo "Validating PEP8 compliance..."
|
||||||
pycodestyle --ignore=W504,E501 netbox/
|
pycodestyle --ignore=W504,E501 netbox/
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
EXIT=1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Checking for missing migrations..."
|
echo "Checking for missing migrations..."
|
||||||
python netbox/manage.py makemigrations --dry-run --check
|
python netbox/manage.py makemigrations --dry-run --check
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
EXIT=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $EXIT != 0 ]; then
|
||||||
|
printf "${RED}COMMIT FAILED${NOCOLOR}\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit $EXIT
|
||||||
|
Reference in New Issue
Block a user