make autoflake more aggressive & fix some lint

This commit is contained in:
ducklet 2020-11-08 10:52:50 +01:00
parent 7c7a1fcde2
commit 76266d8d2f
5 changed files with 12 additions and 6 deletions

View file

@ -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"