aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2023-12-08 12:05:02 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2023-12-29 07:29:15 +0100
commit0195aa4ce2010061b42bacd0b3e13d88007ffacc (patch)
treea3a0ecb5909467edefeca11ec0df69545525bc60
parent024337df24f6f897bdbb3a3bb4ddf24ed562c997 (diff)
Convert check script to work for django
-rwxr-xr-xcheck28
1 files changed, 23 insertions, 5 deletions
diff --git a/check b/check
index cae21d5..b36b1e3 100755
--- a/check
+++ b/check
@@ -10,35 +10,53 @@ then
exit 0
fi
+root=$(readlink -f "$(dirname "$0")")
+
+# print deprecation warnings etc.
export PYTHONDEVMODE=1
+# ignore known warnings from third party libraries
+export PYTHONWARNINGS='default,ignore:::itypes,ignore:::^django[.]'
+
SUBCMD=$1
shift 1
case $SUBCMD in
"tests")
- nose2-3 $COVER_OPT --log-level ERROR -B --log-capture $*
+ cd "$root"
+ ./manage.py test $@
+ cd -
;;
"coverage")
- nose2-3 --with-coverage --coverage-report=term-missing \
- --log-level ERROR -B --log-capture $*
+ cd "$root"
+ python3-coverage run ./manage.py test $@
+ python3-coverage report
+ cd -
;;
"qa")
+ cd "$root"
flake8 --select=E,F,W,C90,E123 --ignore=W503 .
isort --check-only --diff .
if which doc8
then
doc8 .
fi
+ cd -
;;
"typecheck")
- mypy kerbana
+ cd "$root"
+ mypy kerbana rrd
+ cd -
;;
"static")
+ cd "$root"
bandit --recursive --number=3 -lll -iii .
+ cd -
;;
"run")
- flask --app kerbana --debug run
+ cd "$root"
+ ./manage runserver
+ cd -
;;
*)
echo "No such subcommand $SUBCMD"