Skip to content

Commit

Permalink
Auto-update pre-commit hooks (#3631)
Browse files Browse the repository at this point in the history
* Auto-update pre-commit hooks

updates:
- [github.com/codespell-project/codespell: v2.3.0 → v2.4.0](codespell-project/codespell@v2.3.0...v2.4.0)
- [github.com/pre-commit/mirrors-mypy: v1.13.0 → v1.14.1](pre-commit/mirrors-mypy@v1.13.0...v1.14.1)
- [github.com/astral-sh/ruff-pre-commit: v0.8.3 → v0.9.3](astral-sh/ruff-pre-commit@v0.8.3...v0.9.3)

* Apply pre-commit auto fixes

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] and TheJulianJES authored Jan 29, 2025
1 parent 06794e3 commit 3d523e0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ ci:

repos:
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.0
hooks:
- id: codespell
additional_dependencies: [tomli]
args: ["--toml", "pyproject.toml"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v1.14.1
hooks:
- id: mypy

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.3
rev: v0.9.3
hooks:
- id: ruff
args: ["--fix", "--exit-non-zero-on-fix", "--config", "pyproject.toml"]
Expand Down
6 changes: 3 additions & 3 deletions tests/test_quirks.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,9 @@ def test_quirk_importable(quirk: CustomDevice) -> None:
"""Ensure all quirks can be imported with a normal Python `import` statement."""

path = f"{quirk.__module__}.{quirk.__name__}"
assert all(
m and m.isidentifier() for m in path.split(".")
), f"{path} is not importable"
assert all(m and m.isidentifier() for m in path.split(".")), (
f"{path} is not importable"
)


def test_quirk_loading_error(tmp_path: Path, caplog) -> None:
Expand Down
12 changes: 6 additions & 6 deletions tests/test_quirks_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def test_translation_key_and_fallback_name_match() -> None:
quirk_locations, fallback_names = zip(*quirks)
# check that only one fallback name exists for the translation key
# if not, we print the quirk locations to help identify the issue
assert (
len(set(fallback_names)) == 1
), f"Translation key '{translation_key}' is shared by quirks with different fallback names: {quirk_locations}"
assert len(set(fallback_names)) == 1, (
f"Translation key '{translation_key}' is shared by quirks with different fallback names: {quirk_locations}"
)


def test_manufacturer_model_metadata_unique() -> None:
Expand All @@ -67,6 +67,6 @@ def test_manufacturer_model_metadata_unique() -> None:

# check that each manufacturer-model pair is unique
for (manufacturer, model), quirk_locations in man_model_quirk_map.items():
assert (
len(quirk_locations) == 1
), f"Manufacturer-model pair '{manufacturer}' '{model}' is shared by multiple quirks: {quirk_locations}"
assert len(quirk_locations) == 1, (
f"Manufacturer-model pair '{manufacturer}' '{model}' is shared by multiple quirks: {quirk_locations}"
)
2 changes: 1 addition & 1 deletion zhaquirks/tuya/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ def handle_get_data(self, command: TuyaCommand) -> foundation.Status:
# return foundation.Status.UNSUPPORTED_ATTRIBUTE

_LOGGER.debug(
"[0x%04x:%s:0x%04x] Received value %s " "for attribute 0x%04x",
"[0x%04x:%s:0x%04x] Received value %s for attribute 0x%04x",
self.endpoint.device.nwk,
self.endpoint.endpoint_id,
self.cluster_id,
Expand Down

0 comments on commit 3d523e0

Please sign in to comment.