From 573317cada9f3b5cdac572d6ba4b57f43d02e520 Mon Sep 17 00:00:00 2001 From: yinshengkai Date: Tue, 12 Sep 2023 11:27:52 +0800 Subject: [PATCH] tools: checkpach supports python files Signed-off-by: yinshengkai --- tools/checkpatch.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/checkpatch.sh b/tools/checkpatch.sh index f51f63b2a0..620889582a 100755 --- a/tools/checkpatch.sh +++ b/tools/checkpatch.sh @@ -80,7 +80,11 @@ check_file() { esac fi - if [ "$(is_rust_file $@)" == "1" ]; then + if [ ${@##*.} == 'py' ]; then + black --check $@ + flake8 --config ${TOOLDIR}/../.github/linters/setup.cfg $@ + isort $@ + elif [ "$(is_rust_file $@)" == "1" ]; then if ! command -v rustfmt &> /dev/null; then fail=1 elif ! rustfmt --edition 2021 --check $@ 2>&1; then