Enable Ruff PLC0414 (#86799)

This commit is contained in:
Franck Nijhof 2023-01-27 16:32:04 +01:00 committed by GitHub
parent f9f9741d2a
commit 8f74bff354
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 8 additions and 7 deletions

View File

@ -12,7 +12,7 @@ from homeassistant.core import callback
from homeassistant.helpers import device_registry from homeassistant.helpers import device_registry
from homeassistant.util import slugify from homeassistant.util import slugify
from ..const import ATTR_HUE_EVENT, CONF_SUBTYPE, DOMAIN as DOMAIN from ..const import ATTR_HUE_EVENT, CONF_SUBTYPE, DOMAIN
CONF_CONTROL_ID = "control_id" CONF_CONTROL_ID = "control_id"
CONF_DURATION = "duration" CONF_DURATION = "duration"

View File

@ -250,6 +250,7 @@ select = [
"E", # pycodestyle "E", # pycodestyle
"F", # pyflakes/autoflake "F", # pyflakes/autoflake
"PGH004", # Use specific rule codes when using noqa "PGH004", # Use specific rule codes when using noqa
"PLC0414", # Useless import alias. Import alias does not rename original package.
"SIM105", # Use contextlib.suppress({exception}) instead of try-except-pass "SIM105", # Use contextlib.suppress({exception}) instead of try-except-pass
"SIM117", # Merge with-statements that use the same scope "SIM117", # Merge with-statements that use the same scope
"SIM401", # Use get from dict with default instead of an if block "SIM401", # Use get from dict with default instead of an if block

View File

@ -2,7 +2,7 @@
from unittest.mock import Mock, patch from unittest.mock import Mock, patch
from homeassistant.components.device_tracker import DOMAIN as DT_DOMAIN from homeassistant.components.device_tracker import DOMAIN as DT_DOMAIN
from homeassistant.components.freebox.const import DOMAIN as DOMAIN, SERVICE_REBOOT from homeassistant.components.freebox.const import DOMAIN, SERVICE_REBOOT
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.config_entries import ConfigEntryState from homeassistant.config_entries import ConfigEntryState

View File

@ -1,6 +1,6 @@
"""Switch tests for the Goalzero integration.""" """Switch tests for the Goalzero integration."""
from homeassistant.components.goalzero.const import DEFAULT_NAME from homeassistant.components.goalzero.const import DEFAULT_NAME
from homeassistant.components.switch import DOMAIN as DOMAIN from homeassistant.components.switch import DOMAIN
from homeassistant.const import ( from homeassistant.const import (
ATTR_ENTITY_ID, ATTR_ENTITY_ID,
SERVICE_TURN_OFF, SERVICE_TURN_OFF,

View File

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
from collections.abc import Sequence from collections.abc import Sequence
from unittest.mock import Mock, patch as patch from unittest.mock import Mock, patch
from pyheos import ( from pyheos import (
Dispatcher, Dispatcher,

View File

@ -4,7 +4,7 @@ from unittest.mock import call, patch
import pytest import pytest
import requests import requests
from uvcclient import camera as camera, nvr from uvcclient import camera, nvr
from homeassistant.components.camera import ( from homeassistant.components.camera import (
DEFAULT_CONTENT_TYPE, DEFAULT_CONTENT_TYPE,

View File

@ -2,7 +2,7 @@
from unittest.mock import patch from unittest.mock import patch
import uuid import uuid
import pytest as pytest import pytest
from zwave_me_ws import ZWaveMeData from zwave_me_ws import ZWaveMeData
from homeassistant.components.zwave_me import ZWaveMePlatform from homeassistant.components.zwave_me import ZWaveMePlatform

View File

@ -68,7 +68,7 @@ from .common import ( # noqa: E402, isort:skip
async_test_home_assistant, async_test_home_assistant,
get_test_home_assistant, get_test_home_assistant,
init_recorder_component, init_recorder_component,
mock_storage as mock_storage, mock_storage,
) )
from .test_util.aiohttp import mock_aiohttp_client # noqa: E402, isort:skip from .test_util.aiohttp import mock_aiohttp_client # noqa: E402, isort:skip