Skip to content

Commit 2e15ab6

Browse files
sbryngelsonclaude
andcommitted
Fix doc lint for generated pages and hyphenated page IDs
Add build-time generated page IDs (parameters, cli-reference, examples, case_constraints) to the known set, and allow hyphens in @page/@ref ID patterns. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent edefc01 commit 2e15ab6

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

toolchain/mfc/lint_docs.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
"docs/documentation/case.md": CASE_MD_SKIP,
5454
}
5555

56-
# Match @ref page_id patterns
57-
REF_RE = re.compile(r"@ref\s+(\w+)")
56+
# Match @ref page_id patterns (allow hyphens in page IDs like cli-reference)
57+
REF_RE = re.compile(r"@ref\s+([\w-]+)")
5858

5959

6060
def check_docs(repo_root: Path) -> list[str]:
@@ -322,10 +322,13 @@ def check_page_refs(repo_root: Path) -> list[str]:
322322
return []
323323

324324
# Collect all @page identifiers
325-
page_ids = {"citelist"} # Doxygen built-in
325+
# Include Doxygen built-ins and pages generated at build time by
326+
# gen_parameters.sh, gen_cli_reference.sh, examples.sh, and
327+
# gen_case_constraints_docs.py.
328+
page_ids = {"citelist", "parameters", "cli-reference", "examples", "case_constraints"}
326329
for md_file in doc_dir.glob("*.md"):
327330
text = md_file.read_text(encoding="utf-8")
328-
m = re.search(r"^\s*@page\s+(\w+)", text, flags=re.MULTILINE)
331+
m = re.search(r"^\s*@page\s+([\w-]+)", text, flags=re.MULTILINE)
329332
if m:
330333
page_ids.add(m.group(1))
331334

0 commit comments

Comments
 (0)