Skip to content

Commit bfe9e34

Browse files
PDP-908: Remove leading and trailing xquery comments from copyright header (#24)
1 parent 21fd73f commit bfe9e34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/copyrightcheck.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class CopyrightValidator:
1919
"""Validates copyright headers in source files."""
2020

2121
# Common patterns for comment block terminators
22-
TRAILING_COMMENT_TERMINATORS = r'(\*/|-->)\s*$'
22+
TRAILING_COMMENT_TERMINATORS = r'(\*/|-->|:\))\s*$'
2323

2424
def __init__(self, config_file: str):
2525
"""Initialize validator with configuration file."""
@@ -139,8 +139,8 @@ def _extract_copyright_from_content(self, content: str) -> str:
139139
lines = content.split('\n')
140140
# Look for copyright in first 20 lines
141141
for line in lines[:20]:
142-
# Remove common leading comment characters and whitespace (including HTML <!-- starts)
143-
cleaned_line = re.sub(r'^[\s\*#\/]*(?:<!--)?', '', line).strip()
142+
# Remove common leading comment characters and whitespace (including HTML <!-- starts and XQuery (: )
143+
cleaned_line = re.sub(r'^[\s\*#\/]*(?:<!--|\(:)?', '', line).strip()
144144
# Trim common trailing block terminators if present on same line
145145
cleaned_line = re.sub(self.TRAILING_COMMENT_TERMINATORS, '', cleaned_line).strip()
146146
if cleaned_line.lower().startswith('copyright'):

0 commit comments

Comments
 (0)