map-machine/data/githooks/pre-commit
2021-11-10 02:22:34 +03:00

19 lines
437 B
Bash
Executable file

#!/bin/sh
python_files="map_machine setup.py tests data/githooks/commit-msg"
echo "Checking code format with Black..."
if ! black -l 80 --check ${python_files}; then
black -l 80 --diff --color ${python_files}
echo "FAIL"
exit 1
fi
# Link with Flake8.
echo "Lint with Flake8..."
flake8 \
--max-line-length=80 \
--ignore=E203,W503,ANN002,ANN003,ANN101,ANN102 \
${python_files} \
|| { echo "FAIL"; exit 1; }