hotdog/scripts/lint
ducklet 503f367a0d minor script fixes
mypy has no fix function so it shouldn't be called as part of the fix
process.
2020-11-14 14:38:09 +01:00

27 lines
561 B
Bash
Executable file

#!/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 .
)
exit
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; mypy .) || : # ignore
exit "$error"