Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 35.2k
Use CSV-separated outputs @ get-changed-files @ CI #105151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hugovk
merged 9 commits into
python:main
from
webknjaz:maintenance/gha-reusable-docs-workflow--Ana06--get-changed-files--output-formatJun 21, 2023
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4b0020f
Revert "CI: Temporarily skip paths with spaces to avoid error (#105110)"
webknjaz 9517c21
Use CSV-separated outputs @ get-changed-files @ CI
webknjaz 03e0e4c
Add --clean arg to take a list of comma-seperated files to touch
hugovk 1484c9f
React to any "build changed files" command failure
webknjaz 8fd85ab
Quote `touch-clean-files.py --clean` argument
webknjaz f5a5220
No-op fast with empty `--clean` passed for touch
webknjaz 5a9787b
Apply csv arg code comments by Hugo
webknjaz 3e6f488
Refer to `exit` from `sys` explicitly
webknjaz d19d319
Merge branch 'main' into maintenance/gha-reusable-docs-workflow--Ana0…
hugovk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -3,7 +3,9 @@ | ||
| Touch files that must pass Sphinx nit-picky mode | ||
| so they are rebuilt and we can catch regressions. | ||
| """ | ||
| import argparse | ||
| import csv | ||
| import sys | ||
| from pathlib import Path | ||
| wrong_directory_msg = "Must run this script from the repo root" | ||
| @@ -28,14 +30,33 @@ | ||
| rst for rst in Path("Doc/").rglob("*.rst") if rst.parts[1] not in EXCLUDE_SUBDIRS | ||
| } | ||
| with Path("Doc/tools/.nitignore").open() as clean_files: | ||
| DIRTY = { | ||
| parser = argparse.ArgumentParser( | ||
| description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter | ||
| ) | ||
| parser.add_argument("-c", "--clean", help="Comma-separated list of clean files") | ||
| args = parser.parse_args() | ||
| if args.clean: | ||
| clean_files = next(csv.reader([args.clean])) | ||
| CLEAN = { | ||
| Path(filename.strip()) | ||
| for filename in clean_files | ||
| if filename.strip() and not filename.startswith("#") | ||
| if Path(filename.strip()).is_file() | ||
| } | ||
| CLEAN = ALL_RST - DIRTY - EXCLUDE_FILES | ||
| elif args.clean is not None: | ||
hugovk marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| print( | ||
| "Not touching any files: an empty string `--clean` arg value passed.", | ||
| ) | ||
| sys.exit(0) | ||
| else: | ||
| with Path("Doc/tools/.nitignore").open() as ignored_files: | ||
| IGNORED = { | ||
| Path(filename.strip()) | ||
| for filename in ignored_files | ||
| if filename.strip() and not filename.startswith("#") | ||
| } | ||
| CLEAN = ALL_RST - IGNORED - EXCLUDE_FILES | ||
| print("Touching:") | ||
| for filename in sorted(CLEAN): | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.