@@ -102,8 +102,8 @@ def lookup_heading(self, start_heading_line: str) -> SectionHeading:
102102 Returns: the section heading that starts like the heading line
103103 """
104104 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 () ):
107107 return heading
108108 raise LookupError (
109109 f"Could not find heading that starts with: { start_heading_line } " )
@@ -306,8 +306,7 @@ def __str__(self) -> str:
306306 return skeleton_text
307307
308308
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 :
311310 """
312311 Check of the topics files match the skeleton.
313312
@@ -328,8 +327,7 @@ def check_skeletons(skeleton: Skeleton,
328327 return all_files_matched
329328
330329
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 :
333331 """
334332 Update the topics files to match the skeleton.
335333
@@ -381,11 +379,16 @@ def main() -> None:
381379 if not args .topic_paths :
382380
383381 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
386388
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" )))
389392 else :
390393 topic_paths = args .topic_paths
391394
0 commit comments