tools: exit with error if py needs to format
Make CI fail if format not pass. Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
parent
002d89885e
commit
cc711e0c99
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user