mirror of
https://github.com/home-assistant/core.git
synced 2025-04-19 14:57:52 +00:00
15 lines
296 B
Python
15 lines
296 B
Python
"""Manifest validator."""
|
|
|
|
import ast
|
|
from functools import lru_cache
|
|
from pathlib import Path
|
|
|
|
|
|
@lru_cache
|
|
def ast_parse_module(file_path: Path) -> ast.Module:
|
|
"""Parse a module.
|
|
|
|
Cached to avoid parsing the same file for each plugin.
|
|
"""
|
|
return ast.parse(file_path.read_text())
|