@@ -35,6 +35,8 @@ thisdir="$(dirname "${BASH_SOURCE[0]}")" || exit $?
3535topdir=" $( git -C " ${thisdir} " rev-parse --show-toplevel) " || exit $?
3636cd " ${topdir} " || exit $?
3737
38+ errors=()
39+
3840# Parse arguments.
3941apply_arg=" "
4042only_changed=0
@@ -57,29 +59,43 @@ for arg in "$@"; do
5759done
5860
5961echo " Running misc"
60- check/misc
62+ check/misc || errors+=( " check/misc failed " )
6163
6264if [ ${only_changed} -ne 0 ]; then
6365 echo " Running incremental pylint"
64- check/pylint-changed-files
66+ check/pylint-changed-files || errors+=( " check/pylint-changed-files failed " )
6567else
6668 echo " Running pylint"
67- check/pylint
69+ check/pylint || errors+=( " check/pylint failed " )
6870fi
6971
7072echo " Running mypy"
71- check/mypy
73+ check/mypy || errors+=( " check/mypy failed " )
7274
7375echo " Running incremental format"
74- check/format-incremental " ${rev} " " ${apply_arg} "
76+ check/format-incremental " ${rev} " " ${apply_arg} " || errors+=( " check/format-incremental failed " )
7577
7678if [ ${only_changed} -ne 0 ]; then
7779 echo " Running pytest and incremental coverage on changed files"
78- check/pytest-changed-files-and-incremental-coverage " ${rev} "
80+ check/pytest-changed-files-and-incremental-coverage " ${rev} " ||
81+ errors+=( " check/pytest-changed-files-and-incremental-coverage failed" )
7982else
8083 echo " Running pytest and incremental coverage"
81- check/pytest-and-incremental-coverage " ${rev} "
84+ check/pytest-and-incremental-coverage " ${rev} " ||
85+ errors+=( " check/pytest-and-incremental-coverage failed" )
8286fi
8387
8488echo " Running doctest"
85- check/doctest
89+ check/doctest || errors+=( " check/doctest failed" )
90+
91+ echo
92+ if [[ " ${# errors[@]} " == 0 ]]; then
93+ echo " All checks passed."
94+ result=0
95+ else
96+ printf " Some checks failed.\n\n"
97+ printf " %s\n" " ${errors[@]} "
98+ result=1
99+ fi
100+
101+ exit " ${result} "
0 commit comments