Extract item template metadata policy

This commit is contained in:
2026-06-27 02:05:53 +02:00
parent dc94b1c4c1
commit de1d23fb37
6 changed files with 128 additions and 34 deletions
+9
View File
@@ -10,11 +10,17 @@ from __future__ import annotations
import ast
import json
import re
import sys
from pathlib import Path
from typing import Any
ROOT = Path(__file__).resolve().parents[1]
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
import category_template_metadata as template_metadata_policy # noqa: E402
POOL_DEFINITION_KEYS = ("scene_pools", "expression_pools", "composition_pools")
POOL_REFERENCE_KEYS = {
"scene_pool": "scene_pools",
@@ -187,6 +193,9 @@ def _template_axis_errors(path: str, node: dict[str, Any]) -> list[tuple[str, st
or template.get("name")
or ""
).strip()
metadata = template_metadata_policy.template_metadata(template)
for issue in template_metadata_policy.template_metadata_errors(metadata):
errors.append((template_path, issue))
elif isinstance(template, str):
template_text = template
else: