Update flake8 support, stop workaround for modern pyflakes

And use exec to capture the real return code.
This commit is contained in:
Laurent Bachelier 2013-07-21 03:46:25 +02:00
commit b55dbe04fc

View file

@ -15,10 +15,15 @@ if which flake8-python2 >/dev/null 2>&1; then
fi fi
if [ -n "${FLAKE8}" ]; then if [ -n "${FLAKE8}" ]; then
set -e exec ${FLAKE8} --select=E9,F *.py $PYFILES
${FLAKE8} --ignore=E,W --exclude='*_ui.py' *.py $PYFILES
else else
# grep will return 0 only if it founds something, but our script # check for modern pyflakes
# wants to return 0 when it founds nothing! if pyflakes --version >/dev/null 2>&1; then
pyflakes $PYFILES | grep -v redefinition && exit 1 || exit 0 exec pyflakes $PYFILES
fi else
# hide error reported by mistake.
# grep will return 0 only if it founds something, but our script
# wants to return 0 when it founds nothing!
pyflakes $PYFILES | grep -v redefinition && exit 1 || exit 0
fi
fi