File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 41
41
entry : python scripts/check_toc_is_complete.py
42
42
language : python
43
43
name : Check all notebooks appear in table of contents
44
- pass_filenames : false
45
44
types : [jupyter]
46
45
- id : check-no-tests-are-ignored
47
46
entry : python scripts/check_all_tests_are_covered.py
Original file line number Diff line number Diff line change 5
5
You can run it manually with `pre-commit run check-toc --all`.
6
6
"""
7
7
8
- import json
9
8
from pathlib import Path
10
9
import argparse
10
+ import ast
11
11
12
12
if __name__ == "__main__" :
13
13
toc_examples = (Path ("docs" ) / "source/notebooks/table_of_contents_examples.js" ).read_text ()
14
14
toc_tutorials = (Path ("docs" ) / "source/notebooks/table_of_contents_tutorials.js" ).read_text ()
15
15
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 ("{" ) :]),
18
18
}.keys ()
19
19
parser = argparse .ArgumentParser ()
20
20
parser .add_argument ("filenames" , nargs = "*" )
You can’t perform that action at this time.
0 commit comments