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:
parent
2983f3505d
commit
c9394b1c99
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue