-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtox.ini
111 lines (98 loc) · 2.3 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
[tox]
minversion = 3.18
envlist = codestyle,docstyle,errors,types,test,coverage
isolated_build = True
[testenv]
extras = test
commands =
test-py3{5,6,7,8}: pytest {posargs:tests}
[testenv:format]
description = Format code.
skip_install = true
envdir = {toxworkdir}/lint
deps =
black
isort >= 5.0
commands =
isort .
black src/ tests/
[testenv:codestyle]
description = Check code and tests for PEP 8 compliance and code complexity.
skip_install = true
envdir = {toxworkdir}/lint
deps =
flake8
isort >= 5.0
commands =
flake8 --select E,W,C --show-source src/ tests/
isort --check --diff .
[testenv:docstyle]
description = Check docstrings for PEP 257 compliance (Google style).
skip_install = true
envdir = {toxworkdir}/lint
deps =
pydocstyle
commands = pydocstyle src/
[testenv:flake]
description = Find errors with static code analysis.
envdir = {toxworkdir}/lint
deps =
flake8
flake8-gl-codeclimate
commands =
flake8 --format gl-codeclimate --output-file flake.json --select F src/pyvisa_proxy tests/
[testenv:pylint]
description = Find errors with static code analysis.
envdir = {toxworkdir}/lint
deps =
pylint
pylint-gitlab
commands =
pylint --load-plugins=pylint_gitlab --output-format=gitlab-codeclimate:pylint.json,colorized --errors-only src/pyvisa_proxy
[testenv:errors]
description = Find errors with static code analysis.
envdir = {toxworkdir}/lint
deps =
{[testenv:flake]deps}
{[testenv:pylint]deps}
commands =
{[testenv:flake]commands}
{[testenv:pylint]commands}
[testenv:types]
description = Run static type checker.
skip_install = true
envdir = {toxworkdir}/lint
deps =
mypy
types-six
commands =
mypy --check-untyped-defs --no-implicit-optional src/
[testenv:test]
description = Run tests with pytest.
passenv = CI
extras = test
commands =
pytest --cov --cov-report= {posargs:tests}
[testenv:coverage]
description = Measure and report coverage.
deps =
coverage[toml]
commands =
coverage html
coverage xml
coverage report --fail-under 50
[testenv:clean]
description = Remove all generated and temporary files.
skip_install = true
allowlist_externals =
git
deps =
coverage[toml]
commands =
coverage erase
git clean -xfd
[flake8]
ignore = W503,E203
max-line-length = 79
[pydocstyle]
convention = pep257