diff --git a/homeassistant/components/sensor/__init__.py b/homeassistant/components/sensor/__init__.py index b8151256519..6b4e4a17fc2 100644 --- a/homeassistant/components/sensor/__init__.py +++ b/homeassistant/components/sensor/__init__.py @@ -13,7 +13,7 @@ from typing import Any, Final, Self, cast, final from homeassistant.config_entries import ConfigEntry -# pylint: disable=[hass-deprecated-import] +# pylint: disable-next=hass-deprecated-import from homeassistant.const import ( # noqa: F401 ATTR_UNIT_OF_MEASUREMENT, CONF_UNIT_OF_MEASUREMENT, diff --git a/homeassistant/components/shelly/entity.py b/homeassistant/components/shelly/entity.py index 1dc7573b738..69dc6cb9340 100644 --- a/homeassistant/components/shelly/entity.py +++ b/homeassistant/components/shelly/entity.py @@ -551,7 +551,7 @@ class ShellyRpcAttributeEntity(ShellyRpcEntity, Entity): class ShellySleepingBlockAttributeEntity(ShellyBlockAttributeEntity): """Represent a shelly sleeping block attribute entity.""" - # pylint: disable=super-init-not-called + # pylint: disable-next=super-init-not-called def __init__( self, coordinator: ShellyBlockCoordinator, @@ -625,7 +625,7 @@ class ShellySleepingRpcAttributeEntity(ShellyRpcAttributeEntity): entity_description: RpcEntityDescription - # pylint: disable=super-init-not-called + # pylint: disable-next=super-init-not-called def __init__( self, coordinator: ShellyRpcCoordinator, diff --git a/homeassistant/helpers/script.py b/homeassistant/helpers/script.py index c9d8de23b96..a1d045eb542 100644 --- a/homeassistant/helpers/script.py +++ b/homeassistant/helpers/script.py @@ -911,7 +911,7 @@ class _ScriptRun: async def _async_choose_step(self) -> None: """Choose a sequence.""" - # pylint: disable=protected-access + # pylint: disable-next=protected-access choose_data = await self._script._async_get_choose_data(self._step) with trace_path("choose"): @@ -933,7 +933,7 @@ class _ScriptRun: async def _async_if_step(self) -> None: """If sequence.""" - # pylint: disable=protected-access + # pylint: disable-next=protected-access if_data = await self._script._async_get_if_data(self._step) test_conditions = False @@ -1047,7 +1047,7 @@ class _ScriptRun: @async_trace_path("parallel") async def _async_parallel_step(self) -> None: """Run a sequence in parallel.""" - # pylint: disable=protected-access + # pylint: disable-next=protected-access scripts = await self._script._async_get_parallel_scripts(self._step) async def async_run_with_trace(idx: int, script: Script) -> None: @@ -1107,9 +1107,8 @@ class _QueuedScriptRun(_ScriptRun): await super().async_run() def _finish(self) -> None: - # pylint: disable=protected-access if self.lock_acquired: - self._script._queue_lck.release() + self._script._queue_lck.release() # pylint: disable=protected-access self.lock_acquired = False super()._finish() diff --git a/homeassistant/helpers/service.py b/homeassistant/helpers/service.py index a0fe24cb656..4532e1a00ae 100644 --- a/homeassistant/helpers/service.py +++ b/homeassistant/helpers/service.py @@ -73,7 +73,7 @@ ALL_SERVICE_DESCRIPTIONS_CACHE = "all_service_descriptions_cache" @cache def _base_components() -> dict[str, ModuleType]: """Return a cached lookup of base components.""" - # pylint: disable=import-outside-toplevel + # pylint: disable-next=import-outside-toplevel from homeassistant.components import ( alarm_control_panel, calendar, diff --git a/homeassistant/helpers/template.py b/homeassistant/helpers/template.py index 9f280db6c98..070e5b6d9ad 100644 --- a/homeassistant/helpers/template.py +++ b/homeassistant/helpers/template.py @@ -937,7 +937,7 @@ class TemplateStateBase(State): __delitem__ = _readonly # Inheritance is done so functions that check against State keep working - # pylint: disable=super-init-not-called + # pylint: disable-next=super-init-not-called def __init__(self, hass: HomeAssistant, collect: bool, entity_id: str) -> None: """Initialize template state.""" self._hass = hass diff --git a/homeassistant/runner.py b/homeassistant/runner.py index ed49db37f97..10521f80135 100644 --- a/homeassistant/runner.py +++ b/homeassistant/runner.py @@ -163,8 +163,7 @@ async def setup_and_run_hass(runtime_config: RuntimeConfig) -> int: def _enable_posix_spawn() -> None: """Enable posix_spawn on Alpine Linux.""" - # pylint: disable=protected-access - if subprocess._USE_POSIX_SPAWN: + if subprocess._USE_POSIX_SPAWN: # pylint: disable=protected-access return # The subprocess module does not know about Alpine Linux/musl @@ -172,6 +171,7 @@ def _enable_posix_spawn() -> None: # less efficient. This is a workaround to force posix_spawn() # when using musl since cpython is not aware its supported. tag = next(packaging.tags.sys_tags()) + # pylint: disable-next=protected-access subprocess._USE_POSIX_SPAWN = "musllinux" in tag.platform diff --git a/homeassistant/scripts/check_config.py b/homeassistant/scripts/check_config.py index 38fa9cc2463..9a63c73590b 100644 --- a/homeassistant/scripts/check_config.py +++ b/homeassistant/scripts/check_config.py @@ -30,7 +30,6 @@ import homeassistant.util.yaml.loader as yaml_loader REQUIREMENTS = ("colorlog==6.7.0",) _LOGGER = logging.getLogger(__name__) -# pylint: disable=protected-access MOCKS: dict[str, tuple[str, Callable]] = { "load": ("homeassistant.util.yaml.loader.load_yaml", yaml_loader.load_yaml), "load*": ("homeassistant.config.load_yaml", yaml_loader.load_yaml), @@ -166,13 +165,13 @@ def check(config_dir, secrets=False): "secret_cache": {}, } - # pylint: disable=possibly-unused-variable + # pylint: disable-next=possibly-unused-variable def mock_load(filename, secrets=None): """Mock hass.util.load_yaml to save config file names.""" res["yaml_files"][filename] = True return MOCKS["load"][1](filename, secrets) - # pylint: disable=possibly-unused-variable + # pylint: disable-next=possibly-unused-variable def mock_secrets(ldr, node): """Mock _get_secrets.""" try: @@ -201,7 +200,7 @@ def check(config_dir, secrets=False): def secrets_proxy(*args): secrets = Secrets(*args) - res["secret_cache"] = secrets._cache + res["secret_cache"] = secrets._cache # pylint: disable=protected-access return secrets try: