You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/10/14 17:09:00 UTC
(nuttx) 01/02: tools: exit with error if py needs to format
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 01cce0c54425283932db1a3f2b9c1a4d6afde2bb
Author: xuxingliang <xu...@xiaomi.com>
AuthorDate: Fri Aug 9 15:46:16 2024 +0800
tools: exit with error if py needs to format
Make CI fail if format not pass.
Signed-off-by: xuxingliang <xu...@xiaomi.com>
---
tools/checkpatch.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/checkpatch.sh b/tools/checkpatch.sh
index 98cdcb7ffd..292a1e58cb 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