Add pre-push Git hook.

This commit is contained in:
Sergey Vartanov 2021-08-03 01:01:51 +03:00
parent 0f7665d3fd
commit 4984d4a6ad

21
data/githooks/pre-push Executable file
View file

@ -0,0 +1,21 @@
#!/bin/sh
echo "Checking code format with Black..."
black -l 80 --check test roentgen roentgen.py || { echo "FAIL"; exit 1; }
echo "Lint with Flake8..."
flake8 --max-line-length=80 --ignore=E203,W503 --exclude=archive,precommit.py,test/test_road.py || { echo "FAIL"; exit 1; }
echo "Run tests with pytest..."
pytest -v || { echo "FAIL"; exit 1; }
echo "Test render"
python3 roentgen.py render -b 37.415,55.753,37.416,55.754 --cache test/data || { echo "FAIL"; exit 1; }
echo "Test icons"
python3 roentgen.py icons || { echo "FAIL"; exit 1; }
echo "Test MapCSS generation"
python3 roentgen.py mapcss || { echo "FAIL"; exit 1; }
echo "Test element generation"
python3 roentgen.py element --node amenity=bench,material=wood || { echo "FAIL"; exit 1; }
exit 0