Skip to content

Implicit concatenated f-string: Trailing end-of-line comment is moved #15375

Closed
@joostlek

Description

@joostlek

Hey!

So I just started bumping ruff in Home Assistant core to 0.9.0 to match the 2025 python guidelines and I encountered a bug.

https://github.com/home-assistant/core/blob/a10d5c435a4b48c9c2549db28f966f2c08ba3a96/homeassistant/components/knx/climate.py#L212-L217

ruff moved the noqa: SLF001 to the next line, but the next run it starts to complain about that we access a private member.

2024:

        self._attr_unique_id = (
            f"{self._device.temperature.group_address_state}_"
            f"{self._device.target_temperature.group_address_state}_"
            f"{self._device.target_temperature.group_address}_"
            f"{self._device._setpoint_shift.group_address}"  # noqa: SLF001
        )

2025:

        self._attr_unique_id = (
            f"{self._device.temperature.group_address_state}_"
            f"{self._device.target_temperature.group_address_state}_"
            f"{self._device.target_temperature.group_address}_"
            f"{self._device._setpoint_shift.group_address}"
        )  # noqa: SLF001
homeassistant/components/knx/climate.py:216:16: SLF001 Private member accessed: `_setpoint_shift`
    |
214 |             f"{self._device.target_temperature.group_address_state}_"
215 |             f"{self._device.target_temperature.group_address}_"
216 |             f"{self._device._setpoint_shift.group_address}"
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SLF001
217 |         )  # noqa: SLF001
218 |         self.default_hvac_mode: HVACMode = config[
    |

Found 1 error.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingformatterRelated to the formatter

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions