Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-update pre-commit hooks #3631

Merged
merged 3 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading