diff --git a/.architecture-rules.yaml b/.architecture-rules.yaml index 73c62cb9..480a59ce 100644 --- a/.architecture-rules.yaml +++ b/.architecture-rules.yaml @@ -399,6 +399,10 @@ ignore: - "**/__pycache__/**" - "**/migrations/**" - "**/node_modules/**" + - "**/.venv/**" + - "**/venv/**" + - ".venv/**" + - "venv/**" patterns: # Allow HTTPException in specific files diff --git a/scripts/validate_architecture.py b/scripts/validate_architecture.py index a2587b12..55125df3 100755 --- a/scripts/validate_architecture.py +++ b/scripts/validate_architecture.py @@ -557,9 +557,18 @@ class ArchitectureValidator: """Check if file should be ignored""" ignore_patterns = self.config.get("ignore", {}).get("files", []) + # Convert to string for easier matching + file_path_str = str(file_path) + for pattern in ignore_patterns: + # Check if any part of the path matches the pattern if file_path.match(pattern): return True + # Also check if pattern appears in the path (for .venv, venv, etc.) + if "/.venv/" in file_path_str or file_path_str.startswith(".venv/"): + return True + if "/venv/" in file_path_str or file_path_str.startswith("venv/"): + return True return False