Skip to content

Commit 7dda912

Browse files
committed
test: Do not swallow flake8 exit code
1 parent 4ede05d commit 7dda912

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

test/lint/lint-python.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,20 @@ elif PYTHONWARNINGS="ignore" flake8 --version | grep -q "Python 2"; then
9090
exit 0
9191
fi
9292

93-
PYTHONWARNINGS="ignore" flake8 --ignore=B,C,E,F,I,N,W --select=$(IFS=","; echo "${enabled[*]}") $(
93+
EXIT_CODE=0
94+
95+
if ! PYTHONWARNINGS="ignore" flake8 --ignore=B,C,E,F,I,N,W --select=$(IFS=","; echo "${enabled[*]}") $(
9496
if [[ $# == 0 ]]; then
9597
git ls-files "*.py"
9698
else
9799
echo "$@"
98100
fi
99-
)
101+
); then
102+
EXIT_CODE=1
103+
fi
104+
105+
if ! mypy --ignore-missing-imports $(git ls-files "test/functional/*.py"); then
106+
EXIT_CODE=1
107+
fi
100108

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

0 commit comments

Comments
 (0)