Skip to content

Commit

Permalink
add codespell and fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
zxdavb committed Oct 12, 2024
1 parent 9700e10 commit f536471
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/ramses_cc/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_new/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
10 changes: 5 additions & 5 deletions tests/virtual_rf/virtual_rf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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):
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit f536471

Please sign in to comment.