Skip to content

Commit 797ef64

Browse files
committed
htmldocck: catch and error on deprecated syntax
1 parent 94645f6 commit 797ef64

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/etc/htmldocck.py

+14
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,24 @@ def filter_line(line):
297297
re.X | re.UNICODE,
298298
)
299299

300+
DEPRECATED_LINE_PATTERN = re.compile(
301+
r"""
302+
//\s+@
303+
""",
304+
re.X | re.UNICODE,
305+
)
306+
300307

301308
def get_commands(template):
302309
with io.open(template, encoding="utf-8") as f:
303310
for lineno, line in concat_multi_lines(f):
311+
if DEPRECATED_LINE_PATTERN.search(line):
312+
print_err(
313+
lineno,
314+
line,
315+
"Deprecated command syntax, replace `// @` with `//@ `",
316+
)
317+
continue
304318
m = LINE_PATTERN.search(line)
305319
if not m:
306320
continue

0 commit comments

Comments
 (0)