File tree Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change 46
46
continue-on-error : true
47
47
run : |
48
48
# Mark files the pull request modified
49
- touch ${{ steps.changed_files.outputs.added_modified }}
49
+ python Doc/tools/ touch-clean-files.py --clean ${{ steps.changed_files.outputs.added_modified }}
50
50
# Build docs with the '-n' (nit-picky) option; convert warnings to annotations
51
51
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n --keep-going" html 2>&1 |
52
52
python Doc/tools/warnings-to-gh-actions.py
Original file line number Diff line number Diff line change 3
3
Touch files that must pass Sphinx nit-picky mode
4
4
so they are rebuilt and we can catch regressions.
5
5
"""
6
-
6
+ import argparse
7
+ import csv
7
8
from pathlib import Path
8
9
9
10
wrong_directory_msg = "Must run this script from the repo root"
28
29
rst for rst in Path ("Doc/" ).rglob ("*.rst" ) if rst .parts [1 ] not in EXCLUDE_SUBDIRS
29
30
}
30
31
31
- with Path ("Doc/tools/.nitignore" ).open () as clean_files :
32
- DIRTY = {
32
+
33
+ parser = argparse .ArgumentParser (
34
+ description = __doc__ , formatter_class = argparse .RawDescriptionHelpFormatter
35
+ )
36
+ parser .add_argument ("-c" , "--clean" , help = "Comma-separated list of clean files" )
37
+ args = parser .parse_args ()
38
+
39
+ if args .clean :
40
+ clean_files = next (csv .reader ([args .clean ]))
41
+ CLEAN = {
33
42
Path (filename .strip ())
34
43
for filename in clean_files
35
- if filename .strip () and not filename . startswith ( "#" )
44
+ if Path ( filename .strip ()). is_file ( )
36
45
}
37
-
38
- CLEAN = ALL_RST - DIRTY - EXCLUDE_FILES
46
+ else :
47
+ with Path ("Doc/tools/.nitignore" ).open () as ignored_files :
48
+ IGNORED = {
49
+ Path (filename .strip ())
50
+ for filename in ignored_files
51
+ if filename .strip () and not filename .startswith ("#" )
52
+ }
53
+ CLEAN = ALL_RST - IGNORED - EXCLUDE_FILES
39
54
40
55
print ("Touching:" )
41
56
for filename in sorted (CLEAN ):
You can’t perform that action at this time.
0 commit comments