mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
Tooling: requirements_test.txt becomes the single source of backend CI dependencies; pyproject.toml configures ruff (E/F/B/I, E501 excluded by decision) and mypy strict for a grow-only allowlist of six pure modules (junction_limits annotated to pass). The 42 substantive ruff findings are fixed — the B023 loop-variable closures bind their variables as parameter defaults instead of hiding behind noqa, and every remaining noqa carries a reason (guarded by a test). Errors: const.ERROR_CODES / ERROR_CODE_FAMILIES formalise the stable contract; the scanner test proves every emitted code across BOTH paths (send_error literals; class attrs, literal and variable-passed MarkerControlError codes, f-string families) is registered and has a localized message — 22 missing backup.error.* keys added in all four languages. invalid_passage_fields / invalid_partition_opening_jamb_margin ship structured JSON details (legacy format read-compat for one beta), and _errText renders code-first: unknown codes localize, raw English messages go to the console. CI: the backend job lints with ruff, refuses a silently skipped HA harness (import + collect threshold), measures branch coverage over pure+harness, fails below the committed baseline and uploads coverage.xml. quality_scale: docs-troubleshooting/examples honestly done, test-coverage/strict-typing carry staged progress. User-Visible: yes Issue: #42
34 lines
1.2 KiB
TOML
34 lines
1.2 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]
|
|
python_version = "3.13"
|
|
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
|