You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When upgrading to ruff 0.3.1 we encountered a special formatting issue in Ruff which was only happening in the CI.
When running ruff locally it seems to favor this variant:
withpatch(
"bleak.BleakScanner.discovered_devices_and_advertisement_data", # Must patch before we setup
{
"44:44:33:11:23:45": (
MagicMock(address="44:44:33:11:23:45"),
MagicMock(),
)
},
):
But when committing this and pushing this, the CI will complain that this is not correct:
diff --git a/tests/components/bluetooth/test_passive_update_coordinator.py b/tests/components/bluetooth/test_passive_update_coordinator.py
index cbe23142..f4128c98 100644
--- a/tests/components/bluetooth/test_passive_update_coordinator.py+++ b/tests/components/bluetooth/test_passive_update_coordinator.py@@ -142,14 +142,16 @@ async def test_unavailable_callbacks_mark_the_coordinator_unavailable(
) -> None:
"""Test that the coordinator goes unavailable when the bluetooth stack no longer sees the device."""
start_monotonic = time.monotonic()
- with patch(- "bleak.BleakScanner.discovered_devices_and_advertisement_data", # Must patch before we setup- {- "44:44:33:11:23:45": (- MagicMock(address="44:44:33:11:23:45"),- MagicMock(),- )- },+ with (+ patch(+ "bleak.BleakScanner.discovered_devices_and_advertisement_data", # Must patch before we setup+ {+ "44:44:33:11:23:45": (+ MagicMock(address="44:44:33:11:23:45"),+ MagicMock(),+ )+ },+ )
):
CI run
I mean that's strange, they usually are doing the same. But when we listen to the CI and commit what they propose we get this:
diff --git a/tests/components/bluetooth/test_passive_update_coordinator.py b/tests/components/bluetooth/test_passive_update_coordinator.py
index f4128c98..cbe23142 100644
--- a/tests/components/bluetooth/test_passive_update_coordinator.py+++ b/tests/components/bluetooth/test_passive_update_coordinator.py@@ -142,16 +142,14 @@ async def test_unavailable_callbacks_mark_the_coordinator_unavailable(
) -> None:
"""Test that the coordinator goes unavailable when the bluetooth stack no longer sees the device."""
start_monotonic = time.monotonic()
- with (- patch(- "bleak.BleakScanner.discovered_devices_and_advertisement_data", # Must patch before we setup- {- "44:44:33:11:23:45": (- MagicMock(address="44:44:33:11:23:45"),- MagicMock(),- )- },- )+ with patch(+ "bleak.BleakScanner.discovered_devices_and_advertisement_data", # Must patch before we setup+ {+ "44:44:33:11:23:45": (+ MagicMock(address="44:44:33:11:23:45"),+ MagicMock(),+ )+ },
):
await async_setup_component(hass, DOMAIN, {DOMAIN: {}})
await hass.async_block_till_done()
Thanks! There are a few open PRs from today to fix up issues in with formatting. I’m planning to review and merge them tonight (hopefully). I’ll check if they resolve this case.
When upgrading to ruff 0.3.1 we encountered a special formatting issue in Ruff which was only happening in the CI.
When running ruff locally it seems to favor this variant:
But when committing this and pushing this, the CI will complain that this is not correct:
CI run
I mean that's strange, they usually are doing the same. But when we listen to the CI and commit what they propose we get this:
CI run
Within the home assistant project we don't have any specific settings for the formatter (as far as I know).
Good to mention, both locally as in the CI pre-commit is used to run ruff.
Let me know if you need more information.
The text was updated successfully, but these errors were encountered: