From 673615267436f4dc23ed0fad2fdfef7765908d27 Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Fri, 11 Mar 2022 18:56:01 +0100 Subject: Use one script instead of three for tests etc. --- .builds/archlinux.yml | 6 ++++-- .builds/debian_oldstable.yml | 6 ++++-- .builds/debian_stable.yml | 6 ++++-- check | 42 ++++++++++++++++++++++++++++++++++++++++++ run_coverage | 4 ---- run_qa | 3 --- run_tests | 4 ---- 7 files changed, 54 insertions(+), 17 deletions(-) create mode 100755 check delete mode 100755 run_coverage delete mode 100755 run_qa delete mode 100755 run_tests diff --git a/.builds/archlinux.yml b/.builds/archlinux.yml index 58bbb69..b61d55a 100644 --- a/.builds/archlinux.yml +++ b/.builds/archlinux.yml @@ -8,15 +8,17 @@ packages: - python-nose - python-coverage - flake8 + - isort + - doc8 sources: - https://git.sr.ht/~valhalla/lesana tasks: - test: | cd lesana - sh run_coverage + sh check coverage - qa: | cd lesana - sh run_qa + sh check qa triggers: - action: email condition: failure diff --git a/.builds/debian_oldstable.yml b/.builds/debian_oldstable.yml index b61284a..86158e3 100644 --- a/.builds/debian_oldstable.yml +++ b/.builds/debian_oldstable.yml @@ -8,15 +8,17 @@ packages: - python3-nose - python3-coverage - flake8 + - isort + - doc8 sources: - https://git.sr.ht/~valhalla/lesana tasks: - test: | cd lesana - sh run_coverage + sh check coverage - qa: | cd lesana - sh run_qa + sh check qa triggers: - action: email condition: failure diff --git a/.builds/debian_stable.yml b/.builds/debian_stable.yml index c4fdc37..7ef54ea 100644 --- a/.builds/debian_stable.yml +++ b/.builds/debian_stable.yml @@ -8,15 +8,17 @@ packages: - python3-nose - python3-coverage - flake8 + - doc8 + - isort sources: - https://git.sr.ht/~valhalla/lesana tasks: - test: | cd lesana - sh run_coverage + sh check coverage - qa: | cd lesana - sh run_qa + sh check qa triggers: - action: email condition: failure diff --git a/check b/check new file mode 100755 index 0000000..8001db4 --- /dev/null +++ b/check @@ -0,0 +1,42 @@ +#!/bin/sh + +set -e + +if [ $# -lt 1 ] +then + $0 coverage + $0 typecheck + $0 qa + exit 0 +fi + +export PYTHONDEVMODE=1 + +SUBCMD=$1 +shift 1 + +case $SUBCMD in + "tests") + #nose2-3 $COVER_OPT --log-level=ERROR -B --log-capture $* + nosetests3 $* + ;; + "coverage") + #nose2-3 --with-coverage --coverage-report=term \ + # --log-level=ERROR -B --log-capture $* + nosetests3 --with-coverage --cover-erase --cover-package=lesana $* + ;; + "qa") + flake8 --select=E,F,W,C90,E123 --ignore=W503 . + isort --check-only --diff . + doc8 . + ;; + "typecheck") + mypy lesana + ;; + "static") + bandit --recursive --number=3 -lll -iii . + ;; + *) + echo "No such subcommand $SUBCMD" + ;; +esac diff --git a/run_coverage b/run_coverage deleted file mode 100755 index ac67ea1..0000000 --- a/run_coverage +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -nosetests3 --with-coverage --cover-erase --cover-package=lesana -#nose2-3 --with-coverage --coverage-report=term --log-level=ERROR -B --log-capture diff --git a/run_qa b/run_qa deleted file mode 100755 index f9f643f..0000000 --- a/run_qa +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -flake8 --select=E,F,W,C90,E123 --ignore=W503 . diff --git a/run_tests b/run_tests deleted file mode 100755 index b4f44f1..0000000 --- a/run_tests +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -nosetests3 -#nose2-3 --log-level=ERROR -B --log-capture -- cgit v1.2.3