Skip to content

Commit e81db0d

Browse files
ci(docs): ignore generated test-results links in active docs check
1 parent e3628e3 commit e81db0d

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

scripts/check_active_doc_links.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@
2626
LINK_RE = re.compile(r"\[[^\]]+\]\(([^)]+)\)")
2727

2828

29+
def is_generated_test_results_link(target: str) -> bool:
30+
"""Return True when link ultimately points into test-results/.
31+
32+
Accepts forms such as:
33+
- /test-results/...
34+
- test-results/...
35+
- ../test-results/...
36+
- ../../test-results/...
37+
"""
38+
39+
parts = [part for part in target.split("/") if part not in {"", ".", ".."}]
40+
return bool(parts) and parts[0] == "test-results"
41+
42+
2943
def iter_markdown_files() -> list[Path]:
3044
files: list[Path] = []
3145
for root in TARGET_ROOTS:
@@ -71,6 +85,11 @@ def main() -> int:
7185
if not clean_target:
7286
continue
7387

88+
if is_generated_test_results_link(clean_target):
89+
# test-results links are runtime-generated artifacts and
90+
# are not guaranteed to be committed in git.
91+
continue
92+
7493
if clean_target.startswith("/"):
7594
candidate = (REPO_ROOT / clean_target.lstrip("/")).resolve()
7695
else:

0 commit comments

Comments
 (0)