Browse Source

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 <noreply@anthropic.com>
maziggy 4 months ago
parent
commit
d1d4152551

+ 1 - 1
.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

+ 6 - 6
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:

+ 3 - 3
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."""