From c9394b1c9973bb2c0b6651baa285de5e416fbf89 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 15 Feb 2016 16:25:43 +0100 Subject: [PATCH] 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. --- hooks/pre-commit | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hooks/pre-commit b/hooks/pre-commit index 5ac72c1c..4bb0a1ed 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -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 -- 2.30.2