mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Enforce application_credentials type hints (#72214)
This commit is contained in:
parent
c028db00de
commit
ba4031718d
@ -40,12 +40,16 @@ _MODULE_FILTERS: dict[str, re.Pattern] = {
|
||||
"any_platform": re.compile(
|
||||
f"^homeassistant\\.components\\.\\w+\\.({'|'.join([platform.value for platform in Platform])})$"
|
||||
),
|
||||
# application_credentials matches only in the package root (application_credentials.py)
|
||||
"application_credentials": re.compile(
|
||||
r"^homeassistant\.components\.\w+\.(application_credentials)$"
|
||||
),
|
||||
# device_tracker matches only in the package root (device_tracker.py)
|
||||
"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)$")
|
||||
"config_flow": re.compile(r"^homeassistant\.components\.\w+\.(config_flow)$"),
|
||||
}
|
||||
|
||||
_METHOD_MATCH: list[TypeHintMatch] = [
|
||||
@ -135,6 +139,24 @@ _METHOD_MATCH: list[TypeHintMatch] = [
|
||||
},
|
||||
return_type=None,
|
||||
),
|
||||
TypeHintMatch(
|
||||
module_filter=_MODULE_FILTERS["application_credentials"],
|
||||
function_name="async_get_auth_implementation",
|
||||
arg_types={
|
||||
0: "HomeAssistant",
|
||||
1: "str",
|
||||
2: "ClientCredential",
|
||||
},
|
||||
return_type="AbstractOAuth2Implementation",
|
||||
),
|
||||
TypeHintMatch(
|
||||
module_filter=_MODULE_FILTERS["application_credentials"],
|
||||
function_name="async_get_authorization_server",
|
||||
arg_types={
|
||||
0: "HomeAssistant",
|
||||
},
|
||||
return_type="AuthorizationServer",
|
||||
),
|
||||
TypeHintMatch(
|
||||
module_filter=_MODULE_FILTERS["device_tracker"],
|
||||
function_name="setup_scanner",
|
||||
|
Loading…
x
Reference in New Issue
Block a user