@@ -102,8 +102,8 @@ def lookup_heading(self, start_heading_line: str) -> SectionHeading:
102
102
Returns: the section heading that starts like the heading line
103
103
"""
104
104
for heading in self .headings :
105
- if start_heading_line .startswith (
106
- heading .header_text .split (":" )[0 ]):
105
+ if start_heading_line .lower (). startswith (
106
+ heading .header_text .split (":" )[0 ]. lower () ):
107
107
return heading
108
108
raise LookupError (
109
109
f"Could not find heading that starts with: { start_heading_line } " )
@@ -306,8 +306,7 @@ def __str__(self) -> str:
306
306
return skeleton_text
307
307
308
308
309
- def check_skeletons (skeleton : Skeleton ,
310
- topic_paths : tp .Iterator [Path ]) -> bool :
309
+ def check_skeletons (skeleton : Skeleton , topic_paths : tp .List [Path ]) -> bool :
311
310
"""
312
311
Check of the topics files match the skeleton.
313
312
@@ -328,8 +327,7 @@ def check_skeletons(skeleton: Skeleton,
328
327
return all_files_matched
329
328
330
329
331
- def update_skeletons (skeleton : Skeleton ,
332
- topic_paths : tp .Iterator [Path ]) -> None :
330
+ def update_skeletons (skeleton : Skeleton , topic_paths : tp .List [Path ]) -> None :
333
331
"""
334
332
Update the topics files to match the skeleton.
335
333
@@ -381,11 +379,16 @@ def main() -> None:
381
379
if not args .topic_paths :
382
380
383
381
def exclude_non_topic_files (path : Path ) -> bool :
384
- return not (path .name == "skeleton.md"
385
- or str (path ).startswith (".github" ))
382
+ excluded_files = ["skeleton.md" , "Readme.md" ]
383
+ excluded_folders = [".github" , "tools" ]
384
+ for exclude_folder in excluded_folders :
385
+ if str (path ).startswith (exclude_folder ):
386
+ return False
387
+ return path .name not in excluded_files
386
388
387
- topic_paths = filter (exclude_non_topic_files ,
388
- Path ("." ).glob ("**/*.md" ))
389
+ topic_paths = list (
390
+ filter (exclude_non_topic_files ,
391
+ Path ("." ).glob ("**/*.md" )))
389
392
else :
390
393
topic_paths = args .topic_paths
391
394
0 commit comments