make autoflake more aggressive & fix some lint
This commit is contained in:
parent
7c7a1fcde2
commit
76266d8d2f
5 changed files with 12 additions and 6 deletions
11
scripts/lint
11
scripts/lint
|
|
@ -1,11 +1,18 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
autoflake_opts='
|
||||
--remove-duplicate-keys
|
||||
--remove-unused-variables
|
||||
--remove-all-unused-imports
|
||||
--ignore-init-module-imports
|
||||
'
|
||||
|
||||
if [ "$1" = '--fix' ]; then
|
||||
(
|
||||
set -x
|
||||
autoflake --in-place --recursive $autoflake_opts .
|
||||
black .
|
||||
isort --profile black .
|
||||
autoflake --in-place --recursive .
|
||||
mypy . || : # ignore
|
||||
)
|
||||
exit
|
||||
|
|
@ -13,9 +20,9 @@ fi
|
|||
|
||||
error=0
|
||||
|
||||
(set -x; autoflake --check --recursive $autoflake_opts . | uniq) || error=$?
|
||||
(set -x; black --check .) || error=$?
|
||||
(set -x; isort --profile black --check .) || error=$?
|
||||
(set -x; autoflake --check --recursive . | uniq) || error=$?
|
||||
(set -x; mypy .) || : # ignore
|
||||
|
||||
exit "$error"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue