diff options
author | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2023-12-08 12:05:02 +0100 |
---|---|---|
committer | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2023-12-29 07:29:15 +0100 |
commit | 0195aa4ce2010061b42bacd0b3e13d88007ffacc (patch) | |
tree | a3a0ecb5909467edefeca11ec0df69545525bc60 /check | |
parent | 024337df24f6f897bdbb3a3bb4ddf24ed562c997 (diff) |
Convert check script to work for django
Diffstat (limited to 'check')
-rwxr-xr-x | check | 28 |
1 files changed, 23 insertions, 5 deletions
@@ -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" |