hotdog/scripts/lint

22 lines
412 B
Text
Raw Normal View History

2020-11-01 16:31:37 +01:00
#!/bin/sh -e
if [ "$1" = '--fix' ]; then
2020-11-08 01:17:33 +01:00
(
set -x
black .
isort --profile black .
autoflake --in-place --recursive .
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
(set -x; black --check .) || error=$?
(set -x; isort --profile black --check .) || error=$?
2020-11-08 10:35:26 +01:00
(set -x; autoflake --check --recursive . | uniq) || error=$?
(set -x; mypy .) || : # ignore
2020-11-08 01:17:33 +01:00
exit "$error"