File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626LINK_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+
2943def 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 :
You can’t perform that action at this time.
0 commit comments