-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
101 lines (89 loc) · 2.7 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
[tox]
minversion=3.15.1
envlist = format,lint,lint-docs
skipsdist=True
[testenv]
skip_missing_interpreters = true
passenv =
PYTHONWARNINGS
PYTHONDEVMODE
[testenv:ruff]
basepython = python3
deps = ruff==0.7.1
commands =
ruff check {posargs}
# Autoformatter
[testenv:format]
basepython = python3
deps = {[testenv:ruff]deps}
commands =
ruff format {toxinidir}/src
# Linters
[testenv:flake8]
basepython = python3
skip_install = true
deps = flake8~=7.0.0
pydoclint[flake8]
commands =
flake8 {toxinidir}/src/ {posargs}
[testenv:pre-commit]
basepython = python3
skip_install = true
deps = pre-commit
commands =
pre-commit run --all-files --show-diff-on-failure
[testenv:lint]
basepython = python3
deps = {[testenv:ruff]deps}
commands =
{[testenv:ruff]commands}
[testenv:lint-docs]
basepython = python3
deps =
doc8
{[testenv:flake8]deps}
commands =
doc8 {toxinidir}/src
{[testenv:flake8]commands}
## Release tooling
[testenv:build]
basepython = python3
skip_install = true
deps =
build
commands =
python -m build
## pydocstyle
# We may want to adhere to D205 and D415 in the future.
[pydocstyle]
convention = google
match_dir = ^((?!fwpy)(?!\.).).*
add_ignore = D100, # Missing docstring in public module
D105, # Missing docstring in magic method
D104, # Missing docstring in public package
D200, # One-line docstring should fit on one line with quotes
D202, # No blank lines allowed after function docstring
D205, # 1 blank line required between summary line and description
D212, # Multi-line docstring summary should start at the first line
D415, # First line should end with a period, question mark, or exclamation point
## Flake8 Configuration
[flake8]
color = always
extend_ignore =
F841 ; Local variable never used. Use ruff instead.
E125 ; continuation line. Use ruff instead
E203 ; whitespace before ':'. Use ruff instead
E501 ; line too long. Use ruff for this.
DOC301 ; We should allow __init__() to have a docstring.
DOC203 ; Currently don't force return type annotations.
DOC108 ; But we don't force not having type hints
DOC201 ; Ignore until issue is solved: https://github.com/jsh9/pydoclint/issues/125
DOC501 ; Current issues with raise checking
DOC503 ; Current issues with raise checking
# See https://github.com/psf/black/blob/master/README.md#line-length for more details
max-line-length = 88
max-complexity = 40
format = %(cyan)s%(path)s%(reset)s:%(bold)s%(yellow)s%(row)d%(reset)s:%(bold)s%(green)s%(col)d%(reset)s: %(bold)s%(red)s%(code)s%(reset)s %(text)s
# Options for pydoclint
style = google
arg-type-hints-in-signature = False