Files
web2.0-backend/scripts/git/pre-push
T
Aarni Halinen 1ab3180c0d Add 'Wall' flag to pre-push hook
This should help noticing deprecations
2018-02-05 10:25:01 +02:00

25 lines
494 B
Bash
Executable File

#!/bin/bash
PURPLE='\033[0;35m'
NC='\033[0m' # No Color
. "${VIRTUAL_ENV}/bin/activate"
if [ $? -ne 0 ]
then
printf "${PURPLE}Failed to find virtualenv. Skipping pre-push hook.\n${NC}"
exit 0
fi
set -e
printf "${PURPLE}Running pre-push tests.${NC}\n"
printf "${PURPLE}npm tests...${NC}\n"
npm test
printf "${PURPLE}pycodestyle tests...${NC}\n"
pycodestyle .
printf "${PURPLE}unit tests...${NC}\n"
python -Wall manage.py test --noinput
set +e
printf "${PURPLE}Tests passed.${NC}\n"