diff --git a/scripts/validate_architecture.py b/scripts/validate_architecture.py index 8094bf24..61ada4fd 100755 --- a/scripts/validate_architecture.py +++ b/scripts/validate_architecture.py @@ -1006,13 +1006,33 @@ class ArchitectureValidator: ] for file_path in template_files: - # Skip base template and partials - if "base.html" in file_path.name or "partials" in str(file_path): - continue - file_path_str = str(file_path) - # Check exclusion patterns + # Skip base template and partials + is_base_or_partial = "base.html" in file_path.name or "partials" in file_path_str + + # Skip macros directory for FE rules + is_macro = "shared/macros/" in file_path_str or "shared\\macros\\" in file_path_str + + # Skip components showcase page + is_components_page = "components.html" in file_path.name + + content = file_path.read_text() + lines = content.split("\n") + + # FE-001: Check for inline pagination (should use macro) + if not is_base_or_partial and not is_macro and not is_components_page: + self._check_pagination_macro_usage(file_path, content, lines) + + # FE-002: Check for inline SVGs (should use $icon()) + if not is_base_or_partial and not is_macro and not is_components_page: + self._check_icon_helper_usage(file_path, content, lines) + + # Skip base/partials for TPL-001 check + if is_base_or_partial: + continue + + # Check exclusion patterns for TPL-001 skip = False for exclusion in tpl_001_exclusions: if exclusion in file_path_str: @@ -1021,9 +1041,6 @@ class ArchitectureValidator: if skip: continue - content = file_path.read_text() - lines = content.split("\n") - # Check for standalone marker in template (first 5 lines) first_lines = "\n".join(lines[:5]).lower() if "standalone" in first_lines or "noqa: tpl-001" in first_lines: