From 0195aa4ce2010061b42bacd0b3e13d88007ffacc Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Fri, 8 Dec 2023 12:05:02 +0100 Subject: Convert check script to work for django --- check | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'check') 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" -- cgit v1.2.3