fix(fc2a): satisfy ruff 0.15.13 lint — UP017, UP042, I001

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>
This commit is contained in:
2026-05-14 14:11:35 -04:00
parent 117873423b
commit b4e0d680f1
10 changed files with 31 additions and 26 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ by the task. The Quart side uses an async session via the same models.
import hashlib
import shutil
from dataclasses import dataclass
from enum import Enum
from enum import StrEnum
from pathlib import Path
from PIL import Image
@@ -25,7 +25,7 @@ from ..utils.slug import slugify
from .thumbnailer import Thumbnailer
class SkipReason(str, Enum):
class SkipReason(StrEnum):
too_small = "too_small"
too_transparent = "too_transparent"
single_color = "single_color"