updated gh actions

This commit is contained in:
Simon Martens
2025-09-16 19:25:03 +02:00
parent abda1333d8
commit 5894514b11

View File

@@ -28,7 +28,7 @@ def validate_stueck_constraints(tree):
) )
errors.append(error_msg) errors.append(error_msg)
# --- Rule 2: Check for uniqueness of multi-page jumps --- # --- Rule 2: Check for conditional 'order' on ambiguous multi-page entries ---
stuecke_with_bis = root.xpath('//kgpz:beitrag/kgpz:stueck[@bis]', namespaces=ns) stuecke_with_bis = root.xpath('//kgpz:beitrag/kgpz:stueck[@bis]', namespaces=ns)
groups_multi_page = defaultdict(list) groups_multi_page = defaultdict(list)
for stueck in stuecke_with_bis: for stueck in stuecke_with_bis:
@@ -37,10 +37,11 @@ def validate_stueck_constraints(tree):
for key, stuecks in groups_multi_page.items(): for key, stuecks in groups_multi_page.items():
if len(stuecks) > 1: if len(stuecks) > 1:
for stueck in stuecks:
if stueck.get('order') is None:
error_msg = ( error_msg = (
f"Custom Validation Error: Found {len(stuecks)} identical multi-page <stueck> tags. " f"Custom Validation Error: <stueck> on line {stueck.sourceline} is part of an ambiguous multi-page group "
f"The combination of attributes (when='{key[0]}', nr='{key[1]}', von='{key[2]}', bis='{key[3]}') must be unique. " f"(when='{key[0]}', nr='{key[1]}', von='{key[2]}', bis='{key[3]}') but is missing the 'order' attribute."
f"Duplicate found on line {stuecks[1].sourceline}."
) )
errors.append(error_msg) errors.append(error_msg)