File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010import subprocess
1111import sys
1212from pathlib import Path
13- from typing import List
13+ from typing import Iterable , List
1414
1515from links import LinkChecker , print_results
1616
17+ IGNORED_DIRS = ("templates" , "analysis" )
18+
19+
20+ def is_ignored_html_file (path : Path , ignored_dirs : Iterable [str ] = IGNORED_DIRS ) -> bool :
21+ """Return True when the changed file is under an ignored directory."""
22+ ignored = set (ignored_dirs )
23+ return any (part in ignored for part in path .parts )
24+
1725
1826def resolve_changed_html_files (diff_range : str ) -> List [str ]:
1927 """Return changed HTML files from a git diff range."""
@@ -51,7 +59,7 @@ def resolve_changed_html_files(diff_range: str) -> List[str]:
5159 if not line .strip ():
5260 continue
5361 candidate = (repo_root / line .strip ()).resolve ()
54- if candidate .is_file ():
62+ if candidate .is_file () and not is_ignored_html_file ( candidate . relative_to ( repo_root )) :
5563 html_files .append (str (candidate ))
5664 return sorted (set (html_files ))
5765
You can’t perform that action at this time.
0 commit comments