diff --git a/requirements-test-latest.txt b/requirements-test-latest.txt index ae1c0c3..b15f804 100644 --- a/requirements-test-latest.txt +++ b/requirements-test-latest.txt @@ -1,3 +1,5 @@ # Newest published fixtures: Home Assistant 2026.2.3; requires Python 3.13. # Update together with the README's tested-versions note. pytest-homeassistant-custom-component==0.13.316 +# Bug-finding lint (see ruff.toml). +ruff==0.14.0 diff --git a/requirements-test.txt b/requirements-test.txt index 29e3dfa..26d5dce 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,3 +2,5 @@ pytest-homeassistant-custom-component==0.13.298 # aiodns 3.5 (HA's pin) uses APIs removed in pycares 5. pycares==4.11.0 +# Bug-finding lint (see ruff.toml). +ruff==0.14.0 diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..4c86e83 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,6 @@ +# Bug-finding lint only (pyflakes, syntax errors, bugbear); no style rules. +# py39: the offline tests also run on older Pythons, so e.g. zip(strict=) is not available. +target-version = "py39" + +[lint] +select = ["F", "E9", "B"] diff --git a/scripts/check.sh b/scripts/check.sh index 0708bdb..2ff3315 100644 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -4,6 +4,7 @@ set -eu # A transitive HA test dependency otherwise fetches metadata on import. export LITELLM_LOCAL_MODEL_COST_MAP=True python -m pip check +python -m ruff check --no-cache . python -m unittest discover -s tests -v python -m pytest tests/ha -q python -m compileall -q custom_components/heating_mpc