Skip to content

Commit dbbbd98

Browse files
committed
fix(validation): add support for large file exceptions in rule validation
- Introduced a set of exempted files from the 500-line limit, specifically for `ui/cv2.mdc`. - Updated the validation logic to check against this set, improving handling of large reference files in the validation process.
1 parent c043d16 commit dbbbd98

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/ai/validate_rules.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
app = create_app()
1919

20+
# Files exempt from the 500-line limit
21+
LARGE_FILE_EXCEPTIONS: set[str] = {"**/ui/cv2.mdc"}
22+
2023

2124
def _check_rule_frontmatter(
2225
file_path: Path,
@@ -198,7 +201,9 @@ def _validate_rule(file_path: Path) -> list[str]:
198201
is_reference = file_path.name == "rules.mdc"
199202
is_spec = "meta" in file_path.parts
200203
is_docs_rule = "docs" in file_path.parts
201-
is_large_reference = file_path.match("**/ui/cv2.mdc")
204+
is_large_reference = any(
205+
file_path.match(pattern) for pattern in LARGE_FILE_EXCEPTIONS
206+
)
202207

203208
# Check frontmatter
204209
frontmatter_errors, frontmatter = _check_rule_frontmatter(

0 commit comments

Comments
 (0)