diff --git a/.flake8 b/.flake8 index 786115bcb0af119a500067bac8df1d9b4073b8a1..f4cc20cdb9b463d730f1b33406c3ab41de5d367a 100644 --- a/.flake8 +++ b/.flake8 @@ -3,4 +3,4 @@ max-line-length=120 exclude=pystencils/jupyter.py, pystencils/plot.py pystencils/session.py -ignore = W293 W503 W291 +ignore = W293 W503 W291 C901 diff --git a/pre-push b/pre-push new file mode 100755 index 0000000000000000000000000000000000000000..d46b0ee67a7c3b5a29ad7088bc5ffae6b673751f --- /dev/null +++ b/pre-push @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# Checks run before every push +# has to be copied to .git/hooks + +echo "Running pre-push hook" +echo "Running flak8 check" +flake8 --append-config=.flake8 pystencils + +# $? stores exit value of the last command +if [ $? -ne 0 ]; then + echo "flake8 failed" + exit 1 +fi + +python3 setup.py quicktest + +# $? stores exit value of the last command +if [ $? -ne 0 ]; then + echo "quicktest failed" + exit 1 +fi