From 425b1627dfb1d1acfd7871630c2ef48f38323f0d Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 27 May 2024 09:01:51 +0000 Subject: [PATCH] Rephrase comment --- pylint/plugins/hass_imports.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pylint/plugins/hass_imports.py b/pylint/plugins/hass_imports.py index 0319fae7dde..a2474bb78f9 100644 --- a/pylint/plugins/hass_imports.py +++ b/pylint/plugins/hass_imports.py @@ -394,8 +394,7 @@ _OBSOLETE_IMPORT: dict[str, list[ObsoleteImportMatch]] = { ], } -# Should be gradually synchronised with pyproject.toml -# [tool.ruff.lint.flake8-import-conventions.extend-aliases] +# Black list of imports that should be using the namespace _FORCE_NAMESPACE_IMPORT: dict[tuple[str, str], str] = { ("homeassistant.helpers.area_registry", "async_get"): "ar.async_get", ("homeassistant.helpers.device_registry", "async_get"): "dr.async_get", @@ -457,7 +456,7 @@ class HassImportsFormatChecker(BaseChecker): if self.current_package is None: return for module, _alias in node.names: - if module.startswith("{self.current_package}."): + if module.startswith(f"{self.current_package}."): self.add_message("hass-relative-import", node=node) continue if module.startswith("homeassistant.components.") and module.endswith(