From beef3ce76b955877ec999f1d84d40ba623bfb96d Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Mon, 23 Mar 2026 21:55:06 +0100 Subject: [PATCH] fix(arch): extend TPL-009 block name check to merchant templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- scripts/validate/validate_architecture.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/validate/validate_architecture.py b/scripts/validate/validate_architecture.py index bd5710f4..927bd697 100755 --- a/scripts/validate/validate_architecture.py +++ b/scripts/validate/validate_architecture.py @@ -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: