forked from jtesta/ssh-audit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
131 lines (121 loc) · 3.28 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
[tox]
envlist =
py{py3}-{test,pylint,flake8}
py{38,39,310,311,312,313}-{test,mypy,pylint,flake8}
cov
skip_missing_interpreters = true
[testenv]
deps =
test: pytest
test,cov: {[testenv:cov]deps}
test,py{38,39,310,311,312,313}-{type,mypy}: colorama
py{38,39,310,311,312,313}-{type,mypy}: {[testenv:mypy]deps}
py{py3,38,39,310,311,312,313}-{lint,pylint},lint: {[testenv:pylint]deps}
py{py3,38,39,310,311,312,313}-{lint,flake8},lint: {[testenv:flake8]deps}
setenv =
SSHAUDIT = {toxinidir}/src
test: COVERAGE_FILE = {toxinidir}/.coverage.{envname}
type,mypy: MYPYPATH = {toxinidir}/test/stubs
type,mypy: MYPYHTML = {toxinidir}/reports/html/mypy
commands =
test: coverage run --source ssh_audit -m -p -- \
test: pytest -v --junitxml={toxinidir}/reports/junit.{envname}.xml {posargs:test}
test: coverage combine
test: coverage report --show-missing
test: coverage html -d {toxinidir}/reports/html/coverage.{envname}
py{38,39,310,311,312,313}-{type,mypy}: {[testenv:mypy]commands}
py{py3,38,39,310,311,312,313}-{lint,pylint},lint: {[testenv:pylint]commands}
py{py3,38,39,310,311,312,313}-{lint,flake8},lint: {[testenv:flake8]commands}
#ignore_outcome =
# type: true
# lint: true
[testenv:cov]
deps =
coverage
setenv =
COVERAGE_FILE = {toxinidir}/.coverage
commands =
coverage erase
coverage combine
coverage report --show-missing
coverage xml -i -o {toxinidir}/reports/coverage.xml
coverage html -d {toxinidir}/reports/html/coverage
[testenv:mypy]
deps =
colorama
lxml
mypy
commands =
mypy \
--strict \
--show-error-context \
--html-report {env:MYPYHTML}.py3.{envname} \
{posargs:{env:SSHAUDIT}}
[testenv:pylint]
deps =
mccabe
pylint
commands =
pylint \
--rcfile tox.ini \
--load-plugins=pylint.extensions.bad_builtin \
--load-plugins=pylint.extensions.check_elif \
--load-plugins=pylint.extensions.mccabe \
{posargs:{env:SSHAUDIT}}
[testenv:flake8]
deps =
flake8
commands =
flake8 {posargs:{env:SSHAUDIT} {toxinidir}/setup.py {toxinidir}/test {toxinidir}/ssh-audit.py} --statistics
[pylint]
reports = no
#output-format = colorized
indent-string = " "
disable =
broad-except,
duplicate-code,
fixme,
invalid-name,
line-too-long,
missing-docstring,
no-else-raise,
no-else-return,
super-with-arguments, # Can be re-factored, at some point.
too-complex,
too-many-arguments,
too-many-boolean-expressions,
too-many-branches,
too-many-instance-attributes,
too-many-lines,
too-many-locals,
too-many-nested-blocks,
too-many-positional-arguments,
too-many-return-statements,
too-many-statements,
consider-using-f-string
max-complexity = 15
max-args = 8
max-locals = 20
max-returns = 6
max-branches = 15
max-statements = 60
max-parents = 7
max-attributes = 8
min-public-methods = 1
max-public-methods = 20
max-bool-expr = 5
max-nested-blocks = 6
max-line-length = 80
ignore-long-lines = ^\s*(#\s+type:\s+.*|[A-Z0-9_]+\s+=\s+.*|('.*':\s+)?\[.*\],?|assert\s+.*)$
max-module-lines = 2500
[flake8]
# E241 = multiple spaces after operator; should be kept for tabular data
# E303 = too many blank lines
# E501 = line too long
ignore = E241, E303, E501
[pytest]
junit_family = xunit1
[coverage:paths]
source =
src
*/site-packages