Skip to content

Commit ed1dfe6

Browse files
committed
update check-toc script
1 parent 493a938 commit ed1dfe6

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ repos:
4141
entry: python scripts/check_toc_is_complete.py
4242
language: python
4343
name: Check all notebooks appear in table of contents
44-
pass_filenames: false
4544
types: [jupyter]
4645
- id: check-no-tests-are-ignored
4746
entry: python scripts/check_all_tests_are_covered.py

scripts/check_toc_is_complete.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
You can run it manually with `pre-commit run check-toc --all`.
66
"""
77

8-
import json
98
from pathlib import Path
109
import argparse
10+
import ast
1111

1212
if __name__ == "__main__":
1313
toc_examples = (Path("docs") / "source/notebooks/table_of_contents_examples.js").read_text()
1414
toc_tutorials = (Path("docs") / "source/notebooks/table_of_contents_tutorials.js").read_text()
1515
toc_keys = {
16-
**json.loads(toc_examples[toc_examples.find("{") :]),
17-
**json.loads(toc_tutorials[toc_tutorials.find("{") :]),
16+
**ast.literal_eval(toc_examples[toc_examples.find("{") :]),
17+
**ast.literal_eval(toc_tutorials[toc_tutorials.find("{") :]),
1818
}.keys()
1919
parser = argparse.ArgumentParser()
2020
parser.add_argument("filenames", nargs="*")

0 commit comments

Comments
 (0)