pyflakes.sh: Explicit errors

This commit is contained in:
Laurent Bachelier 2013-08-12 15:31:50 +02:00
commit 57d38783b6
2 changed files with 10 additions and 6 deletions

View file

@ -2,11 +2,11 @@
cd $(dirname $0)
cd ..
PYFILES=$(git ls-files|grep '^scripts\|\.py$'|grep -v boilerplate_data|tr '\n' ' ')
grep -n 'class [^( ]\+:$' ${PYFILES} && exit 3
grep -n $'\t\|\s$' $PYFILES && exit 4
grep -Fn '.setlocale' ${PYFILES} && exit 5
grep -Fn '__future__ import with_statement' ${PYFILES} && exit 6
grep -nE 'except [[:alnum:] ]+,[[:alnum:] ]+' ${PYFILES} && exit 7
grep -n 'class [^( ]\+:$' ${PYFILES} && echo 'Error: old class style found, always inherit object' && exit 3
grep -n $'\t\|\s$' $PYFILES && echo 'Error: tabs or trailing whitespace found, remove them' && exit 4
grep -Fn '.setlocale' ${PYFILES} && echo 'Error: do not use setlocale' && exit 5
grep -Fn '__future__ import with_statement' ${PYFILES} && echo 'Error: with_statement useless as we do not support Python 2.5' && exit 6
grep -nE 'except [[:alnum:] ]+,[[:alnum:] ]+' ${PYFILES} && echo 'Error: use new "as" way of naming exceptions' && exit 7
FLAKE8=""
if which flake8 >/dev/null 2>&1; then