style: say which lint rules this repo keeps, then keep them

`[tool.ruff]` set a line length and a target version and nothing else, so which
rules ran depended on the installed ruff's defaults — fine while nobody ran it,
not fine for a CI job that can turn a push red because a tool changed its mind.

The set is named explicitly (E, F, I, UP, SIM, B, RUF) with three ignores that
are each a real decision rather than a shrug: B008, because FastAPI's whole
dependency idiom is a call in a default argument; E501, because wrapping prose
is a formatter's business; and RUF001, because the reports and the bot speak
Russian and "ambiguous character" is the wrong complaint about a string the
user is meant to read.

The 73 findings that remained are fixed — mostly `datetime.timezone.utc` →
`datetime.UTC`, `typing.Callable` → `collections.abc.Callable`, import order,
and unused `noqa` markers — plus seven by hand: `contextlib.suppress` for two
try/except/pass pairs, unpacking instead of list concatenation, one negated
return.

`ruff format` is deliberately *not* adopted: it would reformat 51 files, and
some of the layout here is hand-set (the comment tables, the DNS wire-format
structs) in ways a formatter flattens.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
timka123andClaude Opus 5 committed 2026-10-22 17:28:57 +03:00
1 parent 5facf41f10
commit ec7eedbc66
28 files changed
+84 -68

No files matched your search

+17
View File
@@ -35,6 +35,23 @@ packages = ["app"]
line-length = 90
target-version = "py312"
# Named rather than left to whatever the installed ruff defaults to, because CI
# runs this and a silent default change should not turn a push red. `format` is
# deliberately not enforced: the layout here is hand-set in places (comment
# tables, the DNS wire-format structs) and a formatter would flatten it.
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "SIM", "B", "RUF"]
ignore = [
# FastAPI's whole dependency idiom is a call in a default argument.
"B008",
# A line-length cap on comments and docstrings is for a formatter to decide.
"E501",
# The reports and the bot speak Russian as well as English, and the typography
# is deliberate (× for counts, – in the laundry source's labels). "Ambiguous
# character" is the wrong complaint about a string the user is meant to read.
"RUF001",
]
[tool.pytest.ini_options]
pythonpath = ["."]
testpaths = ["tests"]