parent
f9ac001c39
commit
0572b710c3
1 changed files with 10 additions and 3 deletions
|
|
@ -19,13 +19,20 @@ fi
|
||||||
if [ -n "${FLAKE8}" ]; then
|
if [ -n "${FLAKE8}" ]; then
|
||||||
exec ${FLAKE8} --select=E9,F *.py $PYFILES
|
exec ${FLAKE8} --select=E9,F *.py $PYFILES
|
||||||
else
|
else
|
||||||
|
PYFLAKES=""
|
||||||
|
if which pyflakes >/dev/null 2>&1; then
|
||||||
|
PYFLAKES=pyflakes
|
||||||
|
fi
|
||||||
|
if which pyflakes-python2 >/dev/null 2>&1; then
|
||||||
|
PYFLAKES=pyflakes-python2
|
||||||
|
fi
|
||||||
# check for modern pyflakes
|
# check for modern pyflakes
|
||||||
if pyflakes --version >/dev/null 2>&1; then
|
if ${PYFLAKES} --version >/dev/null 2>&1; then
|
||||||
exec pyflakes $PYFILES
|
exec ${PYFLAKES} $PYFILES
|
||||||
else
|
else
|
||||||
# hide error reported by mistake.
|
# hide error reported by mistake.
|
||||||
# grep will return 0 only if it founds something, but our script
|
# grep will return 0 only if it founds something, but our script
|
||||||
# wants to return 0 when it founds nothing!
|
# wants to return 0 when it founds nothing!
|
||||||
pyflakes $PYFILES | grep -v redefinition && exit 1 || exit 0
|
${PYFLAKES} $PYFILES | grep -v redefinition && exit 1 || exit 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue