-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtox.ini
195 lines (155 loc) · 3.52 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
[tox]
envlist = pytest, flake8, mypy, bandit, vulture
skipsdist=True
[testenv]
deps = pipenv
sdistsrc={toxworkdir}/dist
# ==
# PyTest tests
# ==
[testenv:pytest]
commands=
pipenv install --ignore-pipfile --dev
pipenv run python -m pytest tests --doctest-modules --junitxml=tests/results/test-pytest.xml \
--cov-config=tox.ini --cov \
--cov-report=xml:tests/results/coverage.xml \
--cov-report=html:tests/results/htmlcov \
--cov-report=term
[coverage:run]
source = .
omit =
tests/*
.venv/*
.tox/*
# ==
# MyPy tests
#==
[testenv:mypy]
commands=
pipenv install --ignore-pipfile --dev
-pipenv run mypy --install-types --non-interactive \
--config-file tox.ini \
--junit-xml tests/results/test-mypy.xml \
--exclude 'tests/' \
.
# ==
# mypy config
# ==
[mypy]
install_types = True
follow_imports = silent
ignore_missing_imports = True
warn_return_any = True
warn_unused_configs = True
warn_unreachable =True
warn_unused_ignores = True
warn_redundant_casts = True
show_column_numbers = True
strict_optional = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
check_untyped_defs = True
; strict = True
[mypy-jmespath]
ignore_missing_imports = True
# ==
# Bandit tests
#==
[testenv:bandit]
deps=
bandit
commands=
-bandit -r -l -i -x './tests,./.tox,./.mypy_cache,./vulture.py,./.venv' .
bandit --format xml --output tests/results/test-bandit.xml -r -l -i -x './tests,./.tox,./.mypy_cache,./vulture.py,./.venv' .
# ==
# Vulture tests
#==
[testenv:vulture]
deps=
vulture
flake8-junit-report
click
allowlist_externals = echo
whitelist_externals = vulture.py
commands=
python .devops/vulture.py tests/results/vulture.txt --sort-by-size --min-confidence 70 --exclude .venv,.tox .
commands_post=
flake8_junit tests/results/vulture.txt tests/results/test-vulture.xml
-echo
# ==
# Flake8 tests
#==
[testenv:flake8]
commands=
pipenv install --ignore-pipfile --dev
pipenv run flake8 --version
pipenv run flake8 \
--tee \
--output-file tests/results/flake8.txt \
.
commands_post=
pipenv run flake8_junit tests/results/flake8.txt tests/results/test-flake8.xml
[flake8]
inline-quotes = double
max-line-length = 120
eradicate-aggressive = true
radon-max-cc = 12
radon-show-closures = true
max-local-variables = 6
ignore=
E402,
F821,
N812,
W503,
# Found local import, we allow local import
WPS300,
# Found too short variable name, Ignore this one for now, decide if we want it
WPS111,
# Disallow of f-strings, I understand it but dont share it
WPS305,
# isort expected 1 blank line in imports, found 0
I003,
# Enable Walrus operator, because why not
WPS332,
# Found a line that starts with a dot
WPS348,
per-file-ignores =
# Pytest fixtures
tests/*.py:
WPS442, S101
# Ignore too many noqa comments and init with logic
functions/__init__.py: WPS402, WPS412
# WPS202 Found too many module members
tests/conftest.py: WPS202, WPS442, S101
max-complexity=12
doctests = True
exclude =
.git,
__pycache__,
docs/source/conf.py,
old,
build,
dist,
.venv,
.tox,
.eggs,
*.egg,
[isort]
profile = black
multi_line_output = 3
# ==
# pyright tests
#==
[testenv:pyright]
deps=
-rrequirements.txt
whitelist_externals = pyright
commands=
pyright
# ==
# Pre-commit tests
#==
[testenv:pre-commit]
skip_install = true
deps = pre-commit
commands = pre-commit run --all-files --show-diff-on-failure