Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add list of excluded subdirs, rename to .nitignore
  • Loading branch information
hugovk committed Apr 2, 2023
commit 4bb6dfce44bcb20208d29e9b6e9c0f9a5529795e
4 changes: 2 additions & 2 deletions Doc/tools/dirty-files.txt → Doc/tools/.nitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# These files don't pass Sphinx nit-picky mode, as tested on the CI
# via touch-clean-files.py in doc.yml.
# All RST files under Doc/ -- except these -- must pass Sphinx nit-picky mode,
# as tested on the CI via touch-clean-files.py in doc.yml.
# Add blank lines between files and keep them sorted lexicographically
# to help avoid merge conflicts.

Expand Down
21 changes: 15 additions & 6 deletions Doc/tools/touch-clean-files.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,31 @@

# Exclude these whether they're dirty or clean,
# because they trigger a rebuild of dirty files.
EXCLUDES = {
Path("Doc/includes/wasm-notavail.rst"),
EXCLUDE_FILES = {
Path("Doc/whatsnew/changelog.rst"),
}

# Exclude "Doc/venv/"
ALL_RST = {rst for rst in Path("Doc/").rglob("*.rst") if rst.parts[1] != "venv"}
# Subdirectories of Doc/ to exclude.
EXCLUDE_SUBDIRS = {
".env",
".venv",
"env",
"includes",
"venv",
}

ALL_RST = {
rst for rst in Path("Doc/").rglob("*.rst") if rst.parts[1] not in EXCLUDE_SUBDIRS
}

with Path("Doc/tools/dirty-files.txt").open() as clean_files:
with Path("Doc/tools/.nitignore").open() as clean_files:
DIRTY = {
Path(filename.strip())
for filename in clean_files
if filename.strip() and not filename.startswith("#")
}

CLEAN = ALL_RST - DIRTY - EXCLUDES
CLEAN = ALL_RST - DIRTY - EXCLUDE_FILES

print("Touching:")
for filename in sorted(CLEAN):
Expand Down