1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Update pylint plugin to validate _async_has_devices (#66512)

This commit is contained in:
Marc Mueller
2022-02-14 18:10:50 +01:00
committed by GitHub
parent 8456c6416e
commit ab67ba20f5
10 changed files with 28 additions and 10 deletions

View File

@@ -44,6 +44,8 @@ _MODULE_FILTERS: dict[str, re.Pattern] = {
"device_tracker": re.compile(r"^homeassistant\.components\.\w+\.(device_tracker)$"),
# diagnostics matches only in the package root (diagnostics.py)
"diagnostics": re.compile(r"^homeassistant\.components\.\w+\.(diagnostics)$"),
# config_flow matches only in the package root (config_flow.py)
"config_flow": re.compile(r"^homeassistant\.components\.\w+\.(config_flow)$")
}
_METHOD_MATCH: list[TypeHintMatch] = [
@@ -192,6 +194,14 @@ _METHOD_MATCH: list[TypeHintMatch] = [
},
return_type=UNDEFINED,
),
TypeHintMatch(
module_filter=_MODULE_FILTERS["config_flow"],
function_name="_async_has_devices",
arg_types={
0: "HomeAssistant",
},
return_type="bool",
),
]