-
Notifications
You must be signed in to change notification settings - Fork 0
/
pre-commit
executable file
·29 lines (27 loc) · 1.02 KB
/
pre-commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
set -e
set -o pipefail
echo "Running flake8..."
if [[ $(command -v "flake8") ]]; then
flake8 --ignore=E126,E127,E128,E123,E226,E241,E242,E265,N802,W503,E402,N803,N806,N814,N817,W504 --show-source --statistics isolator.py isolator_injection_init.py isolator_injection_run.py
res=$?
if [[ $res -ne 0 ]]; then
echo "Error: flake8 check failed. Fix the errors (or run git with --no-verify to bypass the check)."
exit $res
fi
else
echo "Warning: flake8 not found. Run 'pip install flake8' to install it."
fi
echo "Running pylint..."
if [[ $(command -v "pylint") ]]; then
#python run-pylint.py --ignore-patterns=".*" --ignore-patterns="#*" --yaml-rcfile=.pylintrc.yml isolator.py
pylint isolator.py isolator_injection_init.py isolator_injection_run.py
res=$?
if [[ $res -ne 0 ]]; then
echo "Error: Pylint found errors. Fix them."
exit $res
fi
else
echo "Warning: pylint not found. Run 'pip install pylint' to install it."
fi
echo "Pylint found no errors."