summaryrefslogtreecommitdiff
path: root/check
blob: 9f0cb8558c37b19003b64e770b2a64a00e6db4f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh

set -e

if [ $# -lt 1 ]
then
    $0 coverage
    $0 typecheck
    $0 qa
    exit 0
fi

if which nose2-3 > /dev/null
then
    NOSE2=nose2-3
else
    NOSE2=nose2
fi

export PYTHONDEVMODE=1

SUBCMD=$1
shift 1

case $SUBCMD in
    "tests")
        $NOSE2 $COVER_OPT --log-level=ERROR -B --log-capture $*
        ;;
    "coverage")
        $NOSE2 --with-coverage --coverage-report=term-missing \
            --log-level=ERROR -B --log-capture $*
        ;;
    "qa")
        flake8 --select=E,F,W,C90,E123 --ignore=W503 .
        isort --check-only --diff .
        doc8 .
        ;;
    "typecheck")
        mypy hazwaz
        ;;
    "static")
        bandit --recursive --number=3 -lll -iii .
        ;;
    *)
        echo "No such subcommand $SUBCMD"
        ;;
esac