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 <xuxingliang@xiaomi.com>
This commit is contained in:
xuxingliang 2024-08-16 09:58:13 +08:00 committed by Xiang Xiao
parent 01cce0c544
commit 143b265d11
2 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@
ignore = W503,W605,E203 ignore = W503,W605,E203
max-complexity = 27 max-complexity = 27
max-line-length = 125 max-line-length = 125
multi_line_output=3
show-source = True show-source = True
statistics = True statistics = True

View File

@ -85,7 +85,7 @@ check_file() {
if [ ${@##*.} == 'py' ]; then if [ ${@##*.} == 'py' ]; then
black --check $@ || fail=1 black --check $@ || fail=1
flake8 --config ${TOOLDIR}/../.github/linters/setup.cfg $@ || 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 elif [ "$(is_rust_file $@)" == "1" ]; then
if ! command -v rustfmt &> /dev/null; then if ! command -v rustfmt &> /dev/null; then
fail=1 fail=1