refactor(types): PEP-604 union sweep + UP007/UP045 enforcement
ruff --select UP007,UP045 --fix converted ~1760 sites across the backend: `Optional[T]` → `T | None`, `Union[X, Y]` → `X | Y`. The remaining module-level alias targets that ruff conservatively skips (BindableFloatInput, ColorList, DeviceConfig) were converted by hand earlier in the pass. black -formatted the result so the wider unions fit cleanly under the 100-char line budget. pyproject.toml now sets [tool.ruff.lint] extend-select = ["UP007", "UP045"] so future legacy imports fire CI on every push. The pre-commit ruff hook was bumped from v0.8.0 -> v0.15.12 to recognise UP045 (split off from UP007 in v0.13).
This commit is contained in:
@@ -16,7 +16,6 @@ from ledgrab.storage.output_target_store import OutputTargetStore
|
||||
from ledgrab.core.processing.processor_manager import ProcessorManager
|
||||
from ledgrab.api import dependencies as deps
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# App + fixtures (isolated from the real main app)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@@ -16,7 +16,6 @@ from ledgrab.core.game_integration.events import GameEvent
|
||||
from ledgrab.storage.game_integration_store import GameIntegrationStore
|
||||
from ledgrab.api import dependencies as deps
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Test adapter for ingestion tests
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@@ -19,7 +19,6 @@ from ledgrab.storage.ha_light_output_target import HALightOutputTarget
|
||||
from ledgrab.storage.wled_output_target import WledOutputTarget
|
||||
from ledgrab.storage.z2m_light_output_target import Z2MLightOutputTarget
|
||||
|
||||
|
||||
EXPECTED_TARGET_CLASSES = {WledOutputTarget, HALightOutputTarget, Z2MLightOutputTarget}
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import pytest
|
||||
|
||||
from ledgrab.api.routes.webhooks import _check_rate_limit, _rate_hits
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Rate limiter unit tests (pure function, no HTTP)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user