Make hassfest strictly typed (#82091)
This commit is contained in:
parent
0b5357de44
commit
97b40b5f49
20 changed files with 132 additions and 97 deletions
|
@ -42,7 +42,7 @@ REMOVE_CODEOWNERS = """
|
|||
"""
|
||||
|
||||
|
||||
def generate_and_validate(integrations: dict[str, Integration], config: Config):
|
||||
def generate_and_validate(integrations: dict[str, Integration], config: Config) -> str:
|
||||
"""Generate CODEOWNERS."""
|
||||
parts = [BASE]
|
||||
|
||||
|
@ -77,7 +77,7 @@ def generate_and_validate(integrations: dict[str, Integration], config: Config):
|
|||
return "\n".join(parts)
|
||||
|
||||
|
||||
def validate(integrations: dict[str, Integration], config: Config):
|
||||
def validate(integrations: dict[str, Integration], config: Config) -> None:
|
||||
"""Validate CODEOWNERS."""
|
||||
codeowners_path = config.root / "CODEOWNERS"
|
||||
config.cache["codeowners"] = content = generate_and_validate(integrations, config)
|
||||
|
@ -95,7 +95,7 @@ def validate(integrations: dict[str, Integration], config: Config):
|
|||
return
|
||||
|
||||
|
||||
def generate(integrations: dict[str, Integration], config: Config):
|
||||
def generate(integrations: dict[str, Integration], config: Config) -> None:
|
||||
"""Generate CODEOWNERS."""
|
||||
codeowners_path = config.root / "CODEOWNERS"
|
||||
with open(str(codeowners_path), "w") as fp:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue