From db0fc0f19b80fd33710611e5297fc0ebffd0f834 Mon Sep 17 00:00:00 2001 From: maziggy Date: Sun, 11 Jan 2026 07:29:26 +0100 Subject: [PATCH] Fix backend code formatting for CI - Update ruff pre-commit hook to v0.14.11 - Apply ruff format to pass CI checks Co-Authored-By: Claude Opus 4.5 --- .pre-commit-config.yaml | 2 +- backend/tests/integration/test_print_lifecycle.py | 12 ++++++------ backend/tests/unit/services/test_bambu_mqtt.py | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 18e9fcbd2..1da6db071 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ repos: # Ruff - Fast Python linter and formatter - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.2 + rev: v0.14.11 hooks: # Linter - id: ruff diff --git a/backend/tests/integration/test_print_lifecycle.py b/backend/tests/integration/test_print_lifecycle.py index 4b8af8c76..24dcde112 100644 --- a/backend/tests/integration/test_print_lifecycle.py +++ b/backend/tests/integration/test_print_lifecycle.py @@ -133,9 +133,9 @@ class TestTimelapseTracking: ) assert client._was_running is True - assert ( - client._timelapse_during_print is True - ), "Timelapse should be detected even when xcam is parsed before state" + assert client._timelapse_during_print is True, ( + "Timelapse should be detected even when xcam is parsed before state" + ) @pytest.mark.asyncio async def test_timelapse_flag_included_in_completion_callback(self): @@ -330,9 +330,9 @@ class TestTimelapseTracking: } ) - assert ( - completion_data["timelapse_was_active"] is True - ), "timelapse_was_active should be True when timelapse was in ipcam" + assert completion_data["timelapse_was_active"] is True, ( + "timelapse_was_active should be True when timelapse was in ipcam" + ) class TestCallbackErrorHandling: diff --git a/backend/tests/unit/services/test_bambu_mqtt.py b/backend/tests/unit/services/test_bambu_mqtt.py index 88d4600da..e529086f5 100644 --- a/backend/tests/unit/services/test_bambu_mqtt.py +++ b/backend/tests/unit/services/test_bambu_mqtt.py @@ -259,9 +259,9 @@ class TestRealisticMessageFlow: # Verify timelapse was detected even though xcam is parsed before state assert mqtt_client._was_running is True, "_was_running should be True after RUNNING state" assert mqtt_client.state.timelapse is True, "state.timelapse should be True" - assert ( - mqtt_client._timelapse_during_print is True - ), "timelapse_during_print should be True when timelapse is in the same message as RUNNING state" + assert mqtt_client._timelapse_during_print is True, ( + "timelapse_during_print should be True when timelapse is in the same message as RUNNING state" + ) def test_timelapse_not_detected_when_disabled(self, mqtt_client): """Test that timelapse is NOT detected when disabled in xcam data."""