-
-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathpyproject.toml
More file actions
294 lines (274 loc) · 8.3 KB
/
pyproject.toml
File metadata and controls
294 lines (274 loc) · 8.3 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
[project]
name = "cloudbot"
requires-python = ">=3.10"
version = "1.5.0"
[tool.isort]
line_length = 80
known_first_party = ["cloudbot", "plugins", "tests"]
known_third_party = ["alembic"]
float_to_top = true
profile = "black"
[tool.black]
line-length = 80
include = '\.pyi?$'
[tool.mypy]
namespace_packages = true
python_version = "3.10"
warn_unused_configs = true
strict = false
strict_optional = true
ignore_missing_imports = true
check_untyped_defs = true
show_error_codes = true
warn_unused_ignores = true
warn_redundant_casts = true
# strict_equality = true
plugins = ["pydantic.mypy"]
follow_imports = "silent"
# disallow_any_generics = true
no_implicit_reexport = true
enable_error_code = [
"deprecated",
"exhaustive-match",
# "explicit-override",
"ignore-without-code",
"mutable-override",
# "possibly-undefined",
# "redundant-expr",
"redundant-self",
"truthy-bool",
"truthy-iterable",
"unimported-reveal",
# "unused-awaitable",
"unused-ignore",
]
[[tool.mypy.overrides]]
module = 'cloudbot.*'
warn_return_any = true
[[tool.mypy.overrides]]
module = 'cloudbot.config'
disallow_untyped_defs = true
[[tool.mypy.overrides]]
module = 'cloudbot.util.*'
warn_return_any = true
[[tool.mypy.overrides]]
module = 'plugins.cryptocurrency'
warn_return_any = true
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
[tool.autoflake]
remove-all-unused-imports = true
in-place = true
expand-star-imports = true
[tool.pytest.ini_options]
addopts = [
"--ignore=venv",
"--ignore=.*",
"--ignore=tools",
"--ignore=alembic",
"--cov=.",
"--cov-report=xml",
"--cov-report=html",
"--doctest-modules",
"--random-order",
"--pythonhashseed=123",
]
testpaths = ["."]
filterwarnings = [
"error",
"ignore:.*asyncio\\.iscoroutinefunction.*:DeprecationWarning:mcstatus.*",
]
asyncio_mode = "strict"
asyncio_default_fixture_loop_scope = "function"
minversion = "8.0"
[tool.coverage.report]
fail_under = 80
exclude_lines = [
"@overload",
"if TYPE_CHECKING:", # Type checking blocks are never accessible at test/runtime
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"class .*\\(.*(Error|Exception)\\):",
"^ *\\.\\.\\.$",
"raise ShouldBeUnreachable",
"if __name__ == .__main__.:",
]
[tool.coverage.run]
branch = true
omit = [
"tests/data/*",
"tests/util/*",
".*", # Ignore any .cache, .venv, etc directories
"venv/*",
"tools/*", # Build/CI tools
"alembic/*",
]
relative_files = true
[tool.nitpick]
style = [
"gh://TotallyNotRobots/nitpick/app-style-3.10.toml",
]
[tool.flynt]
transform-concats = true
transform-joins = true
line-length = 120
aggressive = true
[tool.codespell]
skip = './data'
count = true
quiet-level = 3
ignore-words-list = ["cypher", "decypher", "AHD", "ahd", "astroid"]
[tool.ruff]
line-length = 80
[tool.ruff.lint]
ignore = [
"ANN001", # missing function arg type annotation
"ANN002", # no annotation for *args
"ANN003", # no annotation for kwargs
"ANN201", # missing return type annotation
"ANN202", # missing return type for private function
"ANN204", # missing return type for special method
"ANN205", # missing return type for staticmethod
"ANN206", # missing return type for classmethod
"ANN401", # dynamically typed expressions
"ARG001", # unused function arg
"ARG002", # Unused arg
"ARG003", # unused arg in class method
"ARG004", # unused staticmethod args
"ARG005", # unused lambda arg
"ASYNC110", # use asyncio.Event
"ASYNC251", # no time.sleep in async func
"B007", # unused loop var
"B011", # don't assert False
"B024", # abstract class no abstract methods
"B027", # abstract empty method
"B028", # missing stacklevel
"B905", # strict zip
"BLE001", # catching Exception
"C406", # unnecessary list literal
"C416", # unnecessary list comp
"C417", # replace map with generator
"C420", # unnecessary dict comprehension
"C901", # complex code
"COM812", # trailing comma
"D", # Don't check docs
"D400", # first line should end with period
"D415", # end doc with punctuation
"DTZ", # set timezone for all datetimes
"E501", # line too long
"E731", # don't assign lambda
"E741", # ambiguous var name
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # don't use f-string for exception message, assign to var
"ERA001", # commented-out code
"FBT001", # boolean typed positional arg
"FBT002", # boolean positional arg
"FBT003", # boolean positional arg
"FIX002", # line has todo
"FURB129", # replace readlines() with iter
"FURB167", # re.I alias
"FURB177", # Path.cwd()
"FURB188", # str.removesuffix
"I001", # unsorted import block
"INP001", # namespace packages
"N802", # bad function name
"N806", # variable case
"N818", # exception class name
"PERF102", # use dict.values
"PERF203", # try-except in loop
"PERF401", # list comp
"PIE808", # unnecessary start in range
"PIE810", # merge startswith
"PLC0206", # consider using dict.items
"PLR0911", # too-many-return-statements
"PLR0912", # too-many-branches
"PLR0913", # too-many-arguments
"PLR0915", # too-many-statements
"PLR1730", # replace if with max
"PLR2004", # Magic value
"PLR2044", # line with empty comment
"PLW1641", # no __hash__
"PLW2901", # shadowing loop var
"PLW3301", # nested max calls
"PT001", # bare fixture annotation
"PT006", # parameterize non-tuple args
"PT007", # use list of tuples for parameterize
"PT011", # broad pytest.raises
"PT015", # assertion always fails
"PT017", # use pytest.raises
"PT018", # split assertions
"PT022", # missing teardown
"PT023", # bare asyncio mark
"PTH103", # use Path.mkdir
"PTH120", # use Path.parent
"PTH123", # use Path.open()
"PTH201", # don't pass current dir to path
"PTH208", # use pathlib iterdir
"RET501", # explicit return None
"RET502", # implicit return None
"RET503", # missing explicit return
"RET504", # unnecessary assignment before return
"RSE102", # unnecessary parentheses
"RUF005", # list star instead of concat
"RUF006", # store result from asyncio.ensure_future
"RUF022", # unsorted __all__
"RUF023", # sort slots
"S101", # use of assert
"S105", # possible hardcoded password
"S113", # requests without timeout
"S310", # url open scheme, disallow file: and others
"S311", # insecure random source
"S603", # subprocess untrusted input
"S606", # starting process without a shell
"SIM102", # combine if
"SIM103", # return condition
"SIM105", # suppress exception
"SIM108", # ternary
"SIM110", # use all()
"SIM114", # combine if
"SIM115", # open-with
"SIM118", # dict.keys contains
"SIM201", # use !=
"SLF001", # private memnber access
"T201", # found print
"TD002", # missing author in todo
"TD003", # no issue link
"TD004", # missing colon in todo
"TRY002", # create own exceptions
"TRY003", # avoid specifying long messages outside of the exception class
"TRY300", # use try-except-else
"TRY400", # use logging.exception
]
select = [
"ALL",
]
extend-safe-fixes = ["TC", "UP", "RUF046"]
future-annotations = true
fixable = ["ALL"]
[tool.ruff.lint.flake8-type-checking]
runtime-evaluated-base-classes = ["pydantic.BaseModel", "sqlalchemy.orm.DeclarativeBase", "cloudbot.util.database.Base"]
[tool.alembic]
# path to migration scripts.
# this is typically a path given in POSIX (e.g. forward slashes)
# format, relative to the token %(here)s which refers to the location of this
# ini file
script_location = "%(here)s/alembic"
# additional paths to be prepended to sys.path. defaults to the current working directory.
prepend_sys_path = ["."]
# [[tool.alembic.post_write_hooks]]
# lint with attempts to fix using "ruff" - use the module runner, against the "ruff" module
# name = "ruff"
# type = "module"
# module = "ruff"
# options = "check --fix REVISION_SCRIPT_FILENAME"
#
# [[tool.alembic.post_write_hooks]]
# Alternatively, use the exec runner to execute a binary found on your PATH
# name = "ruff"
# type = "exec"
# executable = "ruff"
# options = "check --fix REVISION_SCRIPT_FILENAME"