b4e0d680f1
Ruff lint surfaced 23 violations across three rules; all addressed: UP017 (Use datetime.UTC alias): Replaced 13 sites of datetime.now(timezone.utc) with datetime.now(UTC), also adjusted from-imports accordingly. UTC is a Python 3.11+ alias for timezone.utc that ruff's pyupgrade rules prefer. UP042 (StrEnum): Replaced `class TagKind(str, Enum)` and `class SkipReason(str, Enum)` with `class Foo(StrEnum)`. StrEnum was added in Python 3.11 stdlib and is the modern idiom. Behavior is equivalent for our usage (the .value attribute, str(member) semantics). I001 (Import sorting): Added `known-first-party = ["backend"]` to ruff.toml's [lint.isort] so ruff groups `backend.*` imports correctly. Without it, ruff treated them as third-party and demanded a different grouping. The existing import order is stdlib → third-party → first-party → local relative, which ruff now accepts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
29 lines
657 B
TOML
29 lines
657 B
TOML
target-version = "py314"
|
|
line-length = 100
|
|
|
|
[lint]
|
|
select = [
|
|
"E", "W", # pycodestyle
|
|
"F", # pyflakes
|
|
"I", # isort
|
|
"UP", # pyupgrade
|
|
"B", # flake8-bugbear
|
|
"C4", # comprehensions
|
|
"ASYNC", # async correctness
|
|
]
|
|
ignore = [
|
|
"E501", # line length, handled by formatter
|
|
]
|
|
|
|
[lint.per-file-ignores]
|
|
"alembic/versions/*.py" = ["E", "F", "I", "UP"]
|
|
"tests/*" = ["F401"]
|
|
|
|
[lint.isort]
|
|
# Tell ruff that `backend` is our first-party module so imports get
|
|
# grouped correctly: stdlib, third-party, first-party, then local relative.
|
|
known-first-party = ["backend"]
|
|
|
|
[format]
|
|
quote-style = "double"
|