Skip to content

Commit

Permalink
test: Do not swallow flake8 exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Jun 5, 2020
1 parent 4ede05d commit 7dda912
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/lint/lint-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,20 @@ elif PYTHONWARNINGS="ignore" flake8 --version | grep -q "Python 2"; then
exit 0
fi

PYTHONWARNINGS="ignore" flake8 --ignore=B,C,E,F,I,N,W --select=$(IFS=","; echo "${enabled[*]}") $(
EXIT_CODE=0

if ! PYTHONWARNINGS="ignore" flake8 --ignore=B,C,E,F,I,N,W --select=$(IFS=","; echo "${enabled[*]}") $(
if [[ $# == 0 ]]; then
git ls-files "*.py"
else
echo "$@"
fi
)
); then
EXIT_CODE=1
fi

if ! mypy --ignore-missing-imports $(git ls-files "test/functional/*.py"); then
EXIT_CODE=1
fi

mypy --ignore-missing-imports $(git ls-files "test/functional/*.py")
exit $EXIT_CODE

0 comments on commit 7dda912

Please sign in to comment.