mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
The new typing step failed on its first CI run — not on our code: mypy parses the sources of the installed homeassistant, and after #392 that is HA 2026.8.3 on python 3.14, which uses 3.14-only syntax (parenthesis-free `except`). With python_version = 3.13 mypy stopped at a syntax error in someone else's file before reaching a single module of ours, which is exactly the silent-nothing the gate exists to prevent — except loud. ruff keeps target-version py313 deliberately: it lints OUR sources and a lower target only withholds newer-syntax suggestions, while mypy has to read the dependency tree the runner actually installs. User-Visible: no Issue: #42
38 lines
1.6 KiB
TOML
38 lines
1.6 KiB
TOML
# #42: tool configuration only — the integration itself ships via HACS, not pip.
|
|
|
|
[tool.ruff]
|
|
target-version = "py313"
|
|
include = ["custom_components/houseplan/**/*.py", "scripts/*.py", "tests_backend/**/*.py"]
|
|
|
|
[tool.ruff.lint]
|
|
# Narrow on purpose (#42: no mass rewrite): errors, pyflakes, bugbear, imports.
|
|
select = ["E", "F", "B", "I"]
|
|
# E501: 291 legacy long lines are NOT rewritten wholesale; length is not a gate.
|
|
ignore = ["E501"]
|
|
|
|
[tool.mypy]
|
|
# 3.14, как и раннер после #392: mypy разбирает исходники установленного
|
|
# homeassistant, а тот уже написан на синтаксисе 3.14 (`except` без скобок) —
|
|
# на более низком python_version проверка падает синтаксической ошибкой в
|
|
# чужом файле, не дойдя до наших модулей.
|
|
python_version = "3.14"
|
|
explicit_package_bases = true
|
|
mypy_path = "."
|
|
# Strict is opt-in per module (#42): the allowlist below only ever GROWS —
|
|
# test/config-schema-parity guards live elsewhere; the backend guard is
|
|
# tests_backend/test_backend_quality.py which fails when a module leaves.
|
|
ignore_missing_imports = true
|
|
follow_imports = "silent"
|
|
no_site_packages = false
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = [
|
|
"custom_components.houseplan.const",
|
|
"custom_components.houseplan.projection",
|
|
"custom_components.houseplan.coordinate_canonicalization",
|
|
"custom_components.houseplan.frontend_asset_manifest",
|
|
"custom_components.houseplan.junction_limits",
|
|
"custom_components.houseplan.plans",
|
|
]
|
|
strict = true
|