Cache AST module parsing in hassfest (#132244)

This commit is contained in:
epenet
2024-12-06 20:55:34 +01:00
committed by GitHub
parent e54d929573
commit 9771998415
10 changed files with 32 additions and 10 deletions

View File

@@ -5,6 +5,7 @@ https://developers.home-assistant.io/docs/core/integration-quality-scale/rules/d
import ast
from script.hassfest import ast_parse_module
from script.hassfest.model import Integration
DIAGNOSTICS_FUNCTIONS = {
@@ -31,7 +32,7 @@ def validate(integration: Integration) -> list[str] | None:
"(is missing diagnostics.py)",
]
diagnostics = ast.parse(diagnostics_file.read_text())
diagnostics = ast_parse_module(diagnostics_file)
if not _has_diagnostics_function(diagnostics):
return [