-
Notifications
You must be signed in to change notification settings - Fork 4
/
tox.ini
67 lines (55 loc) · 1.71 KB
/
tox.ini
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
[tox]
envlist = lint, test, doc
skipsdist = true
[testenv]
setenv = LANG=C.UTF-8
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[lint]
targets= . bin/scap release-scripts/perform-release
[shellcheck]
find = find . -type f -name "*.sh" | grep -vE "^\./(\.git|\.tox|docs/_build|web)/"
extras = release-scripts/scaps-installed-in-beta release-scripts/update-scap-in-beta
[testenv:lint]
deps =
black==23.3.0
flake8==5.0.4
shellcheck-py
allowlist_externals = bash, xargs, flake8
commands_pre =
bash -c 'set -o pipefail; echo {[shellcheck]extras} > {envtmpdir}/shellcheck_files; {[shellcheck]find} >> {envtmpdir}/shellcheck_files'
commands =
xargs -ra {envtmpdir}/shellcheck_files shellcheck
flake8 --count --show-source --statistics \
--extend-ignore=W605,E501,E203 \
--per-file-ignores='scap/__init__.py: F401' \
--extend-exclude=build,docs,dist,bin,web {[lint]targets}
black --check --diff {[lint]targets}
[testenv:reformat]
deps = black==23.3.0
commands = black {[lint]targets}
[testenv:test]
allowlist_externals = bash
commands =
coverage run -m pytest -q -Werror --ignore=tests/scap/integration --junitxml=test-reports/junit.xml {posargs}
coverage html
coverage xml
bash -c 'echo -n "Test coverage "; coverage report | grep ^TOTAL'
[testenv:doc]
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/docs/requirements.txt
commands = sphinx-build -q -W -b html docs/ docs/_build/html
[testenv:venv]
commands = {posargs}
[coverage:run]
omit = tests/scap/*
branch = True
[coverage:report]
show_missing = True
skip_empty = True
[coverage:html]
directory = test-reports/htmlcov
[coverage:xml]
output = test-reports/coverage.xml