-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathdevelop.toml
More file actions
177 lines (157 loc) · 5.16 KB
/
Copy pathdevelop.toml
File metadata and controls
177 lines (157 loc) · 5.16 KB
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
# https://bandit.readthedocs.io/en/latest/config.html
# Skip test B101 because of issue https://github.com/PyCQA/bandit/issues/457
[tool.bandit]
tests = []
skips = ["B101"]
# https://github.com/psf/black#configuration
[tool.black]
line-length = 120
# https://github.com/commitizen-tools/commitizen
# https://commitizen-tools.github.io/commitizen/bump/
[tool.commitizen]
bump_message = """bump: release $current_version → $new_version
Automatically generated by Commitizen.
"""
tag_format = "v$major.$minor.$patch$prerelease"
update_changelog_on_bump = true
version_files = [
"src/package/__init__.py:__version__",
]
major_version_zero = false
version = "2.16.0"
# https://github.com/pytest-dev/pytest-cov
# https://github.com/nedbat/coveragepy
[tool.coverage.report]
fail_under = 100
show_missing = true
[tool.coverage.run]
branch = true
omit = [
"src/package/__main__.py",
]
# https://pycqa.github.io/isort/
[tool.isort]
profile = "black"
multi_line_output = 3
line_length = 120
skip_gitignore = true
# https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml
[tool.mypy]
# mypy_path =
# exclude =
show_error_codes = true
show_column_numbers = true
pretty = true
show_traceback = true
check_untyped_defs = true
incremental = false
strict = true
warn_return_any = true
warn_redundant_casts = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
disallow_any_explicit = true
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
# disable_error_code =
# allow_redefinition =
[[tool.mypy.overrides]]
module = [
"pytest.*",
]
ignore_missing_imports = true
# https://pylint.pycqa.org/en/latest/user_guide/configuration/index.html
[tool.pylint.main]
fail-under = 10.0
suggestion-mode = true
load-plugins = [
"perflint", # A Linter for performance anti-patterns.
"pylint.extensions.bad_builtin",
"pylint.extensions.broad_try_clause",
"pylint.extensions.check_elif",
"pylint.extensions.code_style",
"pylint.extensions.comparison_placement",
"pylint.extensions.confusing_elif",
"pylint.extensions.consider_refactoring_into_while_condition",
"pylint.extensions.consider_ternary_expression",
"pylint.extensions.dict_init_mutate",
# "pylint.extensions.docparams",
# "pylint.extensions.docstyle",
"pylint.extensions.dunder",
"pylint.extensions.empty_comment",
"pylint.extensions.for_any_all",
"pylint.extensions.magic_value",
# "pylint.extensions.mccabe",
"pylint.extensions.no_self_use",
"pylint.extensions.overlapping_exceptions",
"pylint.extensions.private_import",
"pylint.extensions.redefined_loop_name",
"pylint.extensions.redefined_variable_type",
"pylint.extensions.set_membership",
"pylint.extensions.typing",
"pylint.extensions.while_used",
]
disable = [
"fixme",
"line-too-long", # Replaced by Flake8 Bugbear B950 check.
"too-few-public-methods",
"too-many-ancestors",
"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-public-methods",
"too-many-return-statements",
"too-many-statements",
"too-many-try-statements",
]
[tool.pylint.MISCELLANEOUS]
notes = [
"FIXME",
"TODO",
"BUGBUG",
]
[tool.pylint.FORMAT]
max-line-length = 120
# https://docs.pytest.org/en/latest/reference/customize.html#configuration-file-formats
# https://docs.pytest.org/en/latest/reference/reference.html#configuration-options
# https://docs.pytest.org/en/latest/reference/reference.html#command-line-flags
#
# To integrate Hypothesis into pytest and coverage, we use its native plugin:
# https://hypothesis.readthedocs.io/en/latest/details.html#the-hypothesis-pytest-plugin
#
# To discover tests in documentation, we use doctest and the doctest-plus plugin which
# adds multiple useful options to control tests in documentation. More details at:
# https://docs.python.org/3/library/doctest.html
# https://github.com/scientific-python/pytest-doctestplus
#
# To avoid failing pytest when no tests were dicovered, we need an extra plugin:
# https://docs.pytest.org/en/latest/reference/exit-codes.html
# https://github.com/yashtodi94/pytest-custom_exit_code
[tool.pytest.ini_options]
minversion = "7.0"
addopts = """-vv -ra --tb native --durations 0 \
--hypothesis-show-statistics --hypothesis-explain --hypothesis-verbosity verbose \
--doctest-modules --doctest-continue-on-failure --doctest-glob '*.rst' --doctest-plus \
--suppress-no-test-exit-code \
--cov package \
""" # Consider adding --pdb
# https://docs.python.org/3/library/doctest.html#option-flags
doctest_optionflags = "IGNORE_EXCEPTION_DETAIL"
env = [
"PYTHONDEVMODE=1", # https://docs.python.org/3/library/devmode.html
]
filterwarnings = [
"error",
"always::DeprecationWarning",
# https://docs.pytest.org/en/latest/how-to/failures.html#warning-about-unraisable-exceptions-and-unhandled-thread-exceptions
"error::pytest.PytestUnraisableExceptionWarning",
"error::pytest.PytestUnhandledThreadExceptionWarning",
]