File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66REPO_ROOT = pathlib .Path (__file__ ).resolve ().parent .parent
77EM_DASH = chr (0x2014 )
8- SKIP_DIRS = {
8+ ROOT_SKIP_DIRS = {
99 ".git" ,
1010 ".venv" ,
1111 ".uv_cache" ,
1212 ".uv-cache" ,
1313 ".uv_tools" ,
1414 ".uv-tools" ,
1515 ".cache" ,
16- ".pytest_cache" ,
17- "__pycache__" ,
1816 "node_modules" ,
1917 ".next" ,
2018}
19+ RECURSIVE_SKIP_DIRS = {"__pycache__" , ".pytest_cache" }
20+ SKIP_PATH_PREFIXES = {
21+ ("docs" , ".next" ),
22+ ("docs" , "node_modules" ),
23+ }
2124SKIP_SUFFIXES = {
2225 ".png" ,
2326 ".jpg" ,
@@ -52,7 +55,13 @@ def iter_text_files(root: pathlib.Path) -> Iterable[pathlib.Path]:
5255 if not path .is_file ():
5356 continue
5457 rel = path .relative_to (root )
55- if any (part in SKIP_DIRS for part in rel .parts ):
58+ rel_parts = rel .parts
59+ if rel_parts and rel_parts [0 ] in ROOT_SKIP_DIRS :
60+ continue
61+ if any (rel_parts [: len (prefix )] == prefix for prefix in SKIP_PATH_PREFIXES ):
62+ continue
63+ dir_parts = rel_parts [:- 1 ]
64+ if any (part in RECURSIVE_SKIP_DIRS for part in dir_parts ):
5665 continue
5766 if path .suffix .lower () in SKIP_SUFFIXES :
5867 continue
You can’t perform that action at this time.
0 commit comments