mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 01:38:02 +00:00
Enable ISC ruff rule (#113270)
This commit is contained in:
parent
05172d8e4d
commit
7ae852e5ed
@ -9,7 +9,7 @@ from typing import Final
|
|||||||
|
|
||||||
LEASES_REGEX: Final[re.Pattern[str]] = re.compile(
|
LEASES_REGEX: Final[re.Pattern[str]] = re.compile(
|
||||||
r"(?P<ip>([0-9]{1,3}[\.]){3}[0-9]{1,3})"
|
r"(?P<ip>([0-9]{1,3}[\.]){3}[0-9]{1,3})"
|
||||||
+ r"\smac:\s(?P<mac>([0-9a-f]{2}[:-]){5}([0-9a-f]{2}))"
|
r"\smac:\s(?P<mac>([0-9a-f]{2}[:-]){5}([0-9a-f]{2}))"
|
||||||
+ r"\svalid\sfor:\s(?P<timevalid>(-?\d+))"
|
r"\svalid\sfor:\s(?P<timevalid>(-?\d+))"
|
||||||
+ r"\ssec"
|
r"\ssec"
|
||||||
)
|
)
|
||||||
|
@ -23,8 +23,8 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
|
|
||||||
_DEVICES_REGEX = re.compile(
|
_DEVICES_REGEX = re.compile(
|
||||||
r"(?P<name>([^\s]+)?)\s+"
|
r"(?P<name>([^\s]+)?)\s+"
|
||||||
+ r"(?P<ip>([0-9]{1,3}[\.]){3}[0-9]{1,3})\s+"
|
r"(?P<ip>([0-9]{1,3}[\.]){3}[0-9]{1,3})\s+"
|
||||||
+ r"(?P<mac>([0-9a-f]{2}[:-]){5}([0-9a-f]{2}))\s+"
|
r"(?P<mac>([0-9a-f]{2}[:-]){5}([0-9a-f]{2}))\s+"
|
||||||
)
|
)
|
||||||
|
|
||||||
PLATFORM_SCHEMA = PARENT_PLATFORM_SCHEMA.extend(
|
PLATFORM_SCHEMA = PARENT_PLATFORM_SCHEMA.extend(
|
||||||
|
@ -101,8 +101,10 @@ class Plenticore:
|
|||||||
manufacturer="Kostal",
|
manufacturer="Kostal",
|
||||||
model=f"{prod1} {prod2}",
|
model=f"{prod1} {prod2}",
|
||||||
name=settings["scb:network"][hostname_id],
|
name=settings["scb:network"][hostname_id],
|
||||||
sw_version=f'IOC: {device_local["Properties:VersionIOC"]}'
|
sw_version=(
|
||||||
+ f' MC: {device_local["Properties:VersionMC"]}',
|
f'IOC: {device_local["Properties:VersionIOC"]}'
|
||||||
|
f' MC: {device_local["Properties:VersionMC"]}'
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
@ -68,7 +68,7 @@ async def validate_input(hass: HomeAssistant, data):
|
|||||||
# Return the validation result
|
# Return the validation result
|
||||||
address = (
|
address = (
|
||||||
f'{user_data["address"]["street"]} {user_data["address"]["house_number"]}'
|
f'{user_data["address"]["street"]} {user_data["address"]["house_number"]}'
|
||||||
+ f'{user_data["address"]["house_number_ext"]}'
|
f'{user_data["address"]["house_number_ext"]}'
|
||||||
)
|
)
|
||||||
return auth_token, {
|
return auth_token, {
|
||||||
"title": address,
|
"title": address,
|
||||||
|
@ -168,7 +168,7 @@ def _get_token(host, username, password):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
error_message = (
|
error_message = (
|
||||||
"Xiaomi token cannot be refreshed, response from "
|
"Xiaomi token cannot be refreshed, response from "
|
||||||
+ "url: [%s] \nwith parameter: [%s] \nwas: [%s]"
|
"url: [%s] \nwith parameter: [%s] \nwas: [%s]"
|
||||||
)
|
)
|
||||||
_LOGGER.exception(error_message, url, data, result)
|
_LOGGER.exception(error_message, url, data, result)
|
||||||
return
|
return
|
||||||
|
@ -594,6 +594,7 @@ select = [
|
|||||||
"F", # pyflakes/autoflake
|
"F", # pyflakes/autoflake
|
||||||
"G", # flake8-logging-format
|
"G", # flake8-logging-format
|
||||||
"I", # isort
|
"I", # isort
|
||||||
|
"ISC", # flake8-implicit-str-concat
|
||||||
"ICN001", # import concentions; {name} should be imported as {asname}
|
"ICN001", # import concentions; {name} should be imported as {asname}
|
||||||
"N804", # First argument of a class method should be named cls
|
"N804", # First argument of a class method should be named cls
|
||||||
"N805", # First argument of a method should be named self
|
"N805", # First argument of a method should be named self
|
||||||
@ -681,7 +682,6 @@ ignore = [
|
|||||||
"COM812",
|
"COM812",
|
||||||
"COM819",
|
"COM819",
|
||||||
"ISC001",
|
"ISC001",
|
||||||
"ISC002",
|
|
||||||
|
|
||||||
# Disabled because ruff does not understand type of __all__ generated by a function
|
# Disabled because ruff does not understand type of __all__ generated by a function
|
||||||
"PLE0605",
|
"PLE0605",
|
||||||
|
@ -67,9 +67,9 @@ class TelnetMock:
|
|||||||
self.timeout = timeout
|
self.timeout = timeout
|
||||||
self.sample_data = bytes(
|
self.sample_data = bytes(
|
||||||
"|/dev/sda1|WDC WD30EZRX-12DC0B0|29|C|"
|
"|/dev/sda1|WDC WD30EZRX-12DC0B0|29|C|"
|
||||||
+ "|/dev/sdb1|WDC WD15EADS-11P7B2|32|C|"
|
"|/dev/sdb1|WDC WD15EADS-11P7B2|32|C|"
|
||||||
+ "|/dev/sdc1|WDC WD20EARX-22MMMB0|29|C|"
|
"|/dev/sdc1|WDC WD20EARX-22MMMB0|29|C|"
|
||||||
+ "|/dev/sdd1|WDC WD15EARS-00Z5B1|89|F|",
|
"|/dev/sdd1|WDC WD15EARS-00Z5B1|89|F|",
|
||||||
"ascii",
|
"ascii",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -17,9 +17,11 @@ CONFIG_FILE = "file.conf"
|
|||||||
|
|
||||||
VAPID_CONF = {
|
VAPID_CONF = {
|
||||||
"platform": "html5",
|
"platform": "html5",
|
||||||
"vapid_pub_key": "BJMA2gDZEkHaXRhf1fhY_"
|
"vapid_pub_key": (
|
||||||
+ "QbKbhVIHlSJXI0bFyo0eJXnUPOjdgycCAbj-2bMKMKNKs"
|
"BJMA2gDZEkHaXRhf1fhY_"
|
||||||
+ "_rM8JoSnyKGCXAY2dbONI",
|
"QbKbhVIHlSJXI0bFyo0eJXnUPOjdgycCAbj-2bMKMKNKs"
|
||||||
|
"_rM8JoSnyKGCXAY2dbONI"
|
||||||
|
),
|
||||||
"vapid_prv_key": "ZwPgwKpESGuGLMZYU39vKgrekrWzCijo-LsBM3CZ9-c",
|
"vapid_prv_key": "ZwPgwKpESGuGLMZYU39vKgrekrWzCijo-LsBM3CZ9-c",
|
||||||
"vapid_email": "someone@example.com",
|
"vapid_email": "someone@example.com",
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ TEST_CONTENT_HTML_BASE64 = (
|
|||||||
|
|
||||||
TEST_CONTENT_MULTIPART = (
|
TEST_CONTENT_MULTIPART = (
|
||||||
b"\r\nThis is a multi-part message in MIME format.\r\n"
|
b"\r\nThis is a multi-part message in MIME format.\r\n"
|
||||||
+ b"\r\n--Mark=_100584970350292485166\r\n"
|
b"\r\n--Mark=_100584970350292485166\r\n"
|
||||||
+ TEST_CONTENT_TEXT_PLAIN
|
+ TEST_CONTENT_TEXT_PLAIN
|
||||||
+ b"\r\n--Mark=_100584970350292485166\r\n"
|
+ b"\r\n--Mark=_100584970350292485166\r\n"
|
||||||
+ TEST_CONTENT_HTML
|
+ TEST_CONTENT_HTML
|
||||||
@ -110,7 +110,7 @@ TEST_CONTENT_MULTIPART = (
|
|||||||
|
|
||||||
TEST_CONTENT_MULTIPART_BASE64 = (
|
TEST_CONTENT_MULTIPART_BASE64 = (
|
||||||
b"\r\nThis is a multi-part message in MIME format.\r\n"
|
b"\r\nThis is a multi-part message in MIME format.\r\n"
|
||||||
+ b"\r\n--Mark=_100584970350292485166\r\n"
|
b"\r\n--Mark=_100584970350292485166\r\n"
|
||||||
+ TEST_CONTENT_TEXT_BASE64
|
+ TEST_CONTENT_TEXT_BASE64
|
||||||
+ b"\r\n--Mark=_100584970350292485166\r\n"
|
+ b"\r\n--Mark=_100584970350292485166\r\n"
|
||||||
+ TEST_CONTENT_HTML_BASE64
|
+ TEST_CONTENT_HTML_BASE64
|
||||||
@ -119,7 +119,7 @@ TEST_CONTENT_MULTIPART_BASE64 = (
|
|||||||
|
|
||||||
TEST_CONTENT_MULTIPART_BASE64_INVALID = (
|
TEST_CONTENT_MULTIPART_BASE64_INVALID = (
|
||||||
b"\r\nThis is a multi-part message in MIME format.\r\n"
|
b"\r\nThis is a multi-part message in MIME format.\r\n"
|
||||||
+ b"\r\n--Mark=_100584970350292485166\r\n"
|
b"\r\n--Mark=_100584970350292485166\r\n"
|
||||||
+ TEST_CONTENT_TEXT_BASE64_INVALID
|
+ TEST_CONTENT_TEXT_BASE64_INVALID
|
||||||
+ b"\r\n--Mark=_100584970350292485166\r\n"
|
+ b"\r\n--Mark=_100584970350292485166\r\n"
|
||||||
+ TEST_CONTENT_HTML_BASE64
|
+ TEST_CONTENT_HTML_BASE64
|
||||||
|
@ -1308,7 +1308,7 @@ async def test_tags_with_wave() -> None:
|
|||||||
# below data represents an empty wav file
|
# below data represents an empty wav file
|
||||||
tts_data = bytes.fromhex(
|
tts_data = bytes.fromhex(
|
||||||
"52 49 46 46 24 00 00 00 57 41 56 45 66 6d 74 20 10 00 00 00 01 00 02 00"
|
"52 49 46 46 24 00 00 00 57 41 56 45 66 6d 74 20 10 00 00 00 01 00 02 00"
|
||||||
+ "22 56 00 00 88 58 01 00 04 00 10 00 64 61 74 61 00 00 00 00"
|
"22 56 00 00 88 58 01 00 04 00 10 00 64 61 74 61 00 00 00 00"
|
||||||
)
|
)
|
||||||
|
|
||||||
tagged_data = ORIG_WRITE_TAGS(
|
tagged_data = ORIG_WRITE_TAGS(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user