-
Notifications
You must be signed in to change notification settings - Fork 8
/
tox.ini
112 lines (101 loc) · 2.29 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
[tox]
isolated_build = true
envlist =
flake8
pylint
bandit
mypy
black
py3{10,11,12}{,-bench}
[testenv]
description = Unit tests and doctests
changedir = {envtmpdir}
deps =
cli-test-helpers
pytest
pytest-mock
responses
pyfakefs
!bench: pytest-xdist
bench: pytest-benchmark
commands = \
pytest {toxinidir}/tests \
bench: -m bench \
!bench: -m "not bench and not integration" -n auto --dist worksteal \
{posargs}
passenv =
SSH_AUTH_SOCK
HOME
PATH
allowlist_externals =
curl
patch
{toxinidir}/tools/patch-kapitan.sh
[testenv:bandit]
description = PyCQA security linter
deps = bandit
commands = bandit -r --ini {toxinidir}/tox.ini {toxinidir}/commodore/
[testenv:flake8]
description = Static code analysis and code style
deps = flake8
commands = flake8 {toxinidir}
[testenv:pylint]
description = Check for errors and code smells
deps =
pylint
commands =
pylint --rcfile={toxinidir}/tox.ini {toxinidir}/commodore
[testenv:mypy]
description = Run static analysis for typing
deps =
mypy
types-PyYAML
types-requests
types-toml
commands =
# We ignore missing imports since some of our dependencies do not have type information.
# Someday, it might be useful to try and import headers for them. ~chrisglass
mypy --ignore-missing-imports --show-error-codes {toxinidir}/commodore
[testenv:black]
description = Ensure black formatting is applied
deps =
black~=24.1
commands =
black --check {toxinidir}
[bandit]
exclude = .cache,.git,.tox,build,dist,docs,tests
targets = .
skips = B603,B607
[flake8]
exclude = *.egg*,.git,.tox,venv
max-line-length = 120
extend-ignore = E701
[pylint]
[pylint.main]
output-format = colorized
reports = no
disable = invalid-name, missing-function-docstring,missing-class-docstring,missing-module-docstring,fixme
min-public-methods = 1
ignore-paths= [ 'commodore/cruft/.*' ]
[pylint.similarities]
min-similarity-lines=10
[pytest]
python_files =
test_*.py
bench_*.py
python_functions =
test_*
bench_*
markers =
bench
integration
addopts =
--color=yes
--doctest-modules
--ignore=build
--ignore=commodore/component-template
--ignore=commodore/filters
--ignore=commodore/lib
--ignore=dist
--strict-markers
--verbose