diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 33e17d0..032b57b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,6 +10,17 @@ repos: - id: ruff # linter - id: ruff-format # formatter + - repo: https://github.com/codespell-project/codespell + rev: v2.3.0 + hooks: + - id: codespell + args: + - --ignore-words-list=hass,wont + - --skip="./.*,*.csv,*.json,*.ambr" + - --quiet-level=2 + exclude_types: [csv, json, html] + exclude: ^tests/fixtures/|tests/snapshots/ + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 hooks: diff --git a/custom_components/ramses_cc/services.yaml b/custom_components/ramses_cc/services.yaml index ad2d2c8..ebc35b8 100644 --- a/custom_components/ramses_cc/services.yaml +++ b/custom_components/ramses_cc/services.yaml @@ -105,7 +105,7 @@ get_system_faults: num_entries: description: >- - The number of fault log entries to retreive. Default is 8. + The number of fault log entries to retrieve. Default is 8. example: 8 selector: number: diff --git a/tests/tests_new/test_init.py b/tests/tests_new/test_init.py index 9c1d318..82c6185 100644 --- a/tests/tests_new/test_init.py +++ b/tests/tests_new/test_init.py @@ -41,5 +41,5 @@ async def test_entities( assert hass.states.async_all() == snapshot - finally: # Prevent non-useful errors in teardown + finally: # Prevent useless errors in teardown assert await hass.config_entries.async_unload(entry.entry_id) diff --git a/tests/virtual_rf/virtual_rf.py b/tests/virtual_rf/virtual_rf.py index f232a75..9c9f15c 100644 --- a/tests/virtual_rf/virtual_rf.py +++ b/tests/virtual_rf/virtual_rf.py @@ -219,8 +219,8 @@ async def stop(self) -> None: def _cleanup(self) -> None: """Destroy file objects and file descriptors.""" - for fo in self._port_to_object.values(): - fo.close() # also closes corresponding master fd + for fp in self._port_to_object.values(): + fp.close() # also closes corresponding master fd for fd in self._port_to_slave_.values(): os.close(fd) # else this slave fd will persist @@ -234,8 +234,8 @@ async def _poll_ports_for_data(self) -> None: """Send data received from any one port (as .write(data)) to all other ports.""" with contextlib.ExitStack() as stack: - for fo in self._port_to_object.values(): - stack.enter_context(fo) + for fp in self._port_to_object.values(): + stack.enter_context(fp) while True: for key, _ in self._selector.select(timeout=0): @@ -264,7 +264,7 @@ def _cast_frame_to_all_ports(self, src_port: _PN, frame: bytes) -> None: for dst_port in self._port_to_master: self._push_frame_to_dst_port(dst_port, frame) - # see if there is a faked reponse (RP/I) for a given command (RQ/W) + # see if there is a faked response (RP/I) for a given command (RQ/W) if not (reply := self._find_reply_for_cmd(frame)): return