Skip to content

Commit

Permalink
htmldocck: catch and error on deprecated syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
yotamofek committed Mar 1, 2025
1 parent 94645f6 commit 797ef64
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/etc/htmldocck.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,24 @@ def filter_line(line):
re.X | re.UNICODE,
)

DEPRECATED_LINE_PATTERN = re.compile(
r"""
//\s+@
""",
re.X | re.UNICODE,
)


def get_commands(template):
with io.open(template, encoding="utf-8") as f:
for lineno, line in concat_multi_lines(f):
if DEPRECATED_LINE_PATTERN.search(line):
print_err(
lineno,
line,
"Deprecated command syntax, replace `// @` with `//@ `",
)
continue
m = LINE_PATTERN.search(line)
if not m:
continue
Expand Down

0 comments on commit 797ef64

Please sign in to comment.