Skip to content

Commit

Permalink
ran lint
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-sanche committed Aug 12, 2024
1 parent b395a57 commit 34505a3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/scripts/patch_devsite_toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ def __init__(self, dir_name, index_file_name):
# add files explictly included in the toc
if line.startswith(".. include::"):
file_base = os.path.splitext(line.split("::")[1].strip())[0]
self.items.append(self.extract_toc_entry(file_base, file_title=file_base.capitalize()))
self.items.append(
self.extract_toc_entry(
file_base, file_title=file_base.capitalize()
)
)
continue
if line.startswith(".. toctree::"):
in_toc = True
Expand Down Expand Up @@ -153,7 +157,9 @@ def validate_toc(toc_file_path, expected_section_list, added_sections):
current_toc = yaml.safe_load(open(toc_file_path, "r"))
# make sure the set of sections matches what we expect
found_sections = [d["name"] for d in current_toc[0]["items"]]
assert found_sections == expected_section_list, f"Expected {expected_section_list}, found {found_sections}"
assert (
found_sections == expected_section_list
), f"Expected {expected_section_list}, found {found_sections}"
# make sure each customs ection is in the toc
for section in added_sections:
assert section.title in found_sections
Expand Down

0 comments on commit 34505a3

Please sign in to comment.