From cc711e0c999dd89c0221b408e832ddbec7fb5ea9 Mon Sep 17 00:00:00 2001 From: xuxingliang Date: Fri, 9 Aug 2024 15:46:16 +0800 Subject: [PATCH] tools: exit with error if py needs to format Make CI fail if format not pass. Signed-off-by: xuxingliang --- tools/checkpatch.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/checkpatch.sh b/tools/checkpatch.sh index db3c48d5a92..992a87c3e90 100755 --- a/tools/checkpatch.sh +++ b/tools/checkpatch.sh @@ -83,9 +83,9 @@ check_file() { fi if [ ${@##*.} == 'py' ]; then - black --check $@ - flake8 --config ${TOOLDIR}/../.github/linters/setup.cfg $@ - isort $@ + black --check $@ || fail=1 + flake8 --config ${TOOLDIR}/../.github/linters/setup.cfg $@ || fail=1 + isort $@ || fail=1 elif [ "$(is_rust_file $@)" == "1" ]; then if ! command -v rustfmt &> /dev/null; then fail=1