From 143b265d1188cffc6288f5c7cd42b796a7d30c6b Mon Sep 17 00:00:00 2001 From: xuxingliang Date: Fri, 16 Aug 2024 09:58:13 +0800 Subject: [PATCH] tools: make isort and black formatters to work together Config multi line output to mode 3, so isort and black can agree with each other: ``` 3 - Vertical Hanging Indent from third_party import ( lib1, lib2, lib3, lib4, ) ``` Signed-off-by: xuxingliang --- .github/linters/setup.cfg | 1 + tools/checkpatch.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/linters/setup.cfg b/.github/linters/setup.cfg index b0224c1475..1f065ea750 100644 --- a/.github/linters/setup.cfg +++ b/.github/linters/setup.cfg @@ -2,6 +2,7 @@ ignore = W503,W605,E203 max-complexity = 27 max-line-length = 125 +multi_line_output=3 show-source = True statistics = True diff --git a/tools/checkpatch.sh b/tools/checkpatch.sh index 292a1e58cb..4e591c3adf 100755 --- a/tools/checkpatch.sh +++ b/tools/checkpatch.sh @@ -85,7 +85,7 @@ check_file() { if [ ${@##*.} == 'py' ]; then black --check $@ || fail=1 flake8 --config ${TOOLDIR}/../.github/linters/setup.cfg $@ || fail=1 - isort $@ || fail=1 + isort --settings-path ${TOOLDIR}/../.github/linters/setup.cfg $@ || fail=1 elif [ "$(is_rust_file $@)" == "1" ]; then if ! command -v rustfmt &> /dev/null; then fail=1