2020-11-01 16:31:37 +01:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
2020-11-08 10:52:50 +01:00
|
|
|
autoflake_opts='
|
|
|
|
|
--remove-duplicate-keys
|
|
|
|
|
--remove-unused-variables
|
|
|
|
|
--remove-all-unused-imports
|
|
|
|
|
--ignore-init-module-imports
|
|
|
|
|
'
|
|
|
|
|
|
2020-11-01 16:31:37 +01:00
|
|
|
if [ "$1" = '--fix' ]; then
|
2020-11-08 01:17:33 +01:00
|
|
|
(
|
|
|
|
|
set -x
|
2020-11-08 10:52:50 +01:00
|
|
|
autoflake --in-place --recursive $autoflake_opts .
|
2020-11-08 01:17:33 +01:00
|
|
|
black .
|
|
|
|
|
isort --profile black .
|
2020-11-08 10:35:26 +01:00
|
|
|
mypy . || : # ignore
|
2020-11-08 01:17:33 +01:00
|
|
|
)
|
|
|
|
|
exit
|
2020-11-01 16:31:37 +01:00
|
|
|
fi
|
2020-11-08 01:17:33 +01:00
|
|
|
|
|
|
|
|
error=0
|
|
|
|
|
|
2020-11-08 10:52:50 +01:00
|
|
|
(set -x; autoflake --check --recursive $autoflake_opts . | uniq) || error=$?
|
2020-11-08 01:17:33 +01:00
|
|
|
(set -x; black --check .) || error=$?
|
|
|
|
|
(set -x; isort --profile black --check .) || error=$?
|
2020-11-08 10:35:26 +01:00
|
|
|
(set -x; mypy .) || : # ignore
|
2020-11-08 01:17:33 +01:00
|
|
|
|
|
|
|
|
exit "$error"
|