chiark / gitweb /
pre-commit: make pyflakes optional to support older platforms
authorHans-Christoph Steiner <hans@eds.org>
Mon, 15 Feb 2016 15:25:43 +0000 (16:25 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Mon, 15 Feb 2016 22:06:31 +0000 (23:06 +0100)
Travis-CI defaults to Ubuntu/precise, which has a very old version of
pyflakes that throws false positives.

hooks/pre-commit

index 5ac72c1cb6a55d28de440a7052671204cb59d6cf..4bb0a1edf7744ca65ae29248a688659ad8fccf61 100755 (executable)
@@ -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