# Python Quality Matrix ## Configuration detection - Read `pyproject.toml` first. - Detect the configured Python version. - Detect `mypy`, `ty`, `ruff`, `deptry`, `pytest`, and formatter configuration. ## Review rules - If `mypy` is configured, check the actual options before judging missing annotations or strictness violations. - If `ty` is configured, use its configured expectations and error model. - If both exist, respect whichever toolchain the project clearly treats as authoritative, and flag inconsistent duplication. - If `ruff` is configured, review for meaningful rule violations, not cosmetic churn. - If `deptry` is configured, verify dependency placement, unused dependencies, and hidden transitive reliance. ## Modern Python usage - Use modern typing syntax only when the configured Python version supports it. - Prefer `typing.Self`, `typing.TypeAliasType`, `typing.override`, `collections.abc` imports, `match`, `enum.StrEnum`, dataclass slots, and other newer features only when they improve clarity and compatibility. - Do not suggest a newer language feature that the configured interpreter cannot run. ## Common harsh checks - Weak or missing type boundaries. - Hidden `Any` spread. - Async misuse. - Leaky ORM or transport models. - Overly dynamic code that defeats static analysis. - Wrong dependency classification.