pre-commit: make pyflakes optional to support older platforms

Travis-CI defaults to Ubuntu/precise, which has a very old version of
pyflakes that throws false positives.
This commit is contained in:
Hans-Christoph Steiner 2016-02-15 16:25:43 +01:00
parent 2983f3505d
commit c9394b1c99
1 changed files with 6 additions and 1 deletions

View File

@ -63,6 +63,10 @@ err() {
exit 1
}
warn() {
echo WARNING: "$@"
}
cmd_exists() {
command -v $1 1>/dev/null
}
@ -72,7 +76,8 @@ if cmd_exists pyflakes-python2; then
elif cmd_exists pyflakes; then
PYFLAKES=pyflakes
else
err "pyflakes is not installed!"
PYFLAKES=echo
warn "pyflakes is not installed, using dummy placeholder!"
fi
if cmd_exists pep8-python2; then