diff --git a/pyproject.toml b/pyproject.toml index f267c7d..6f8a0a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,3 +35,9 @@ where = ["src"] [tool.pytest.ini_options] testpaths = ["tests"] pythonpath = ["src"] + +[tool.pyright] +include = ["src"] +extraPaths = ["src"] +pythonVersion = "3.11" +reportMissingImports = true diff --git a/src/atm/main.py b/src/atm/main.py index 297128f..03995d7 100644 --- a/src/atm/main.py +++ b/src/atm/main.py @@ -6,9 +6,13 @@ import os import sys import time from pathlib import Path +from typing import TYPE_CHECKING, cast from atm.config import Config # stdlib-only (tomllib); safe at module level +if TYPE_CHECKING: + from atm.state_machine import DotColor + # Module-level reference — set lazily by _cmd_dryrun; tests may monkeypatch it. dryrun = None @@ -208,7 +212,7 @@ def run_live(cfg, duration_s=None, capture_stub: bool = False) -> None: # detection res = detector.step(now) if res.accepted and res.color: - tr = fsm.feed(res.color, now) + tr = fsm.feed(cast("DotColor", res.color), now) audit.log({ "ts": now, "event": "tick", "color": res.color, "state": tr.next.value, "reason": tr.reason,