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:
28 files changed
+84
-68
No files matched your search
@@ -51,7 +51,7 @@ class SourceResult:
|
||||
error: str | None = None
|
||||
|
||||
@classmethod
|
||||
def failed(cls, source: str, error: str) -> "SourceResult":
|
||||
def failed(cls, source: str, error: str) -> SourceResult:
|
||||
return cls(source=source, items=[], ok=False, error=error)
|
||||
|
||||
|
||||
|
||||
@@ -11,8 +11,9 @@ still things you can spend a pomodoro on.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Iterator
|
||||
from datetime import date
|
||||
from typing import Any, Iterator
|
||||
from typing import Any
|
||||
|
||||
import httpx
|
||||
|
||||
|
||||
@@ -13,8 +13,9 @@ notices it has left the "open issues" query. One owner per task.
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
from collections.abc import Iterator
|
||||
from datetime import date
|
||||
from typing import Any, Iterator
|
||||
from typing import Any
|
||||
|
||||
import httpx
|
||||
|
||||
|
||||
@@ -8,8 +8,9 @@ empty task list.
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from collections.abc import Callable
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from typing import Any, Callable
|
||||
from typing import Any
|
||||
|
||||
from app.settings_schema import AppSettings
|
||||
from app.sources.base import SourceError, SourceResult, TodoItem
|
||||
|
||||
@@ -9,8 +9,9 @@ for people who want the narrower list.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Iterator
|
||||
from datetime import date
|
||||
from typing import Any, Iterator
|
||||
from typing import Any
|
||||
|
||||
import httpx
|
||||
|
||||
|
||||
Reference in new issue
Block a user