fix(arch): extend TPL-009 block name check to merchant templates

The block name validation (scripts → extra_scripts, etc.) only checked
admin and store templates, missing merchant. Added is_merchant flag.
This would have caught the {% block scripts %} bug in merchant/team.html.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-23 21:55:06 +01:00
parent 884a694718
commit beef3ce76b

View File

@@ -848,6 +848,7 @@ class ArchitectureValidator:
is_admin = "/admin/" in file_path_str or "\\admin\\" in file_path_str
is_store = "/store/" in file_path_str or "\\store\\" in file_path_str
is_shop = "/shop/" in file_path_str or "\\shop\\" in file_path_str
is_merchant = "/merchant/" in file_path_str or "\\merchant\\" in file_path_str
if is_base_or_partial:
print("⏭️ Skipping base/partial template")
@@ -881,8 +882,8 @@ class ArchitectureValidator:
# TPL-008: Check for call table_header() pattern (should be table_header_custom)
self._check_table_header_call_pattern(file_path, content, lines)
# TPL-009: Check for invalid block names (admin and store use same blocks)
if is_admin or is_store:
# TPL-009: Check for invalid block names (admin, store, and merchant use same blocks)
if is_admin or is_store or is_merchant:
self._check_valid_block_names(file_path, content, lines)
if is_base_or_partial: