Update pre-commit script

This commit is contained in:
Jan Tuomi
2018-01-25 22:22:37 +02:00
parent f8e68acd4d
commit cf50050eba
2 changed files with 15 additions and 7 deletions
+1
View File
@@ -30,6 +30,7 @@ Set up your SSH key authentication in GitLab Profile Settings. Then clone the re
git clone git@git.sahkoinsinoorikilta.fi:vtmk/web2.0.git git clone git@git.sahkoinsinoorikilta.fi:vtmk/web2.0.git
cd web2.0 cd web2.0
git checkout develop git checkout develop
cp scripts/git/pre-commit .git/hooks/pre-commit # install a script to test code before committing
``` ```
## Windows install instructions ## Windows install instructions
+14 -7
View File
@@ -1,17 +1,24 @@
. "VIRTUALENV_ACTIVATE" #!/bin/bash
if [ $? -ne 0 ]
then
echo "Failed to source virtualenv. Skipping pre-commit hook."
exit 0;
fi
set -e
PURPLE='\033[0;35m' PURPLE='\033[0;35m'
NC='\033[0m' # No Color NC='\033[0m' # No Color
. "${VIRTUAL_ENV}/bin/activate"
if [ $? -ne 0 ]
then
printf "${PURPLE}Failed to find virtualenv. Skipping pre-commit hook.\n${NC}"
exit 0
fi
set -e
printf "${PURPLE}Running pre-commit tests.${NC}\n" printf "${PURPLE}Running pre-commit tests.${NC}\n"
printf "${PURPLE}npm tests...${NC}\n"
npm test npm test
printf "${PURPLE}pycodestyle tests...${NC}\n"
pycodestyle . pycodestyle .
printf "${PURPLE}unit tests...${NC}\n"
python manage.py test --noinput python manage.py test --noinput
set +e set +e