diff options
| author | Mike Frysinger <vapier@google.com> | 2026-01-06 00:46:35 -0500 |
|---|---|---|
| committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2026-01-06 10:17:32 -0800 |
| commit | 1dad86dc0063a6860b92e0ff0c66c4010a47dc35 (patch) | |
| tree | 4e479942efa4224cdb9231d28b9c97f9f0db61f7 | |
| parent | 622a5bf9c2937fbfc631ccc30d5debf74010361d (diff) | |
| download | git-repo-1dad86dc0063a6860b92e0ff0c66c4010a47dc35.tar.gz | |
check-metadata: skip files that do not exist
If the files don't exist, then they can't have errors, so skip checking.
Change-Id: I3ed4be4912b253c5454df41d690cb33dfe191289
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/540003
Reviewed-by: Gavin Mak <gavinmak@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
Commit-Queue: Mike Frysinger <vapier@google.com>
| -rwxr-xr-x | release/check-metadata.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/release/check-metadata.py b/release/check-metadata.py index e17932daa..951bd4c2c 100755 --- a/release/check-metadata.py +++ b/release/check-metadata.py | |||
| @@ -90,7 +90,10 @@ def check_license(path: Path, lines: list[str]) -> bool: | |||
| 90 | 90 | ||
| 91 | def check_path(opts: argparse.Namespace, path: Path) -> bool: | 91 | def check_path(opts: argparse.Namespace, path: Path) -> bool: |
| 92 | """Check a single path.""" | 92 | """Check a single path.""" |
| 93 | data = path.read_text(encoding="utf-8") | 93 | try: |
| 94 | data = path.read_text(encoding="utf-8") | ||
| 95 | except FileNotFoundError: | ||
| 96 | return True | ||
| 94 | lines = data.splitlines() | 97 | lines = data.splitlines() |
| 95 | # NB: Use list comprehension and not a generator so we run all the checks. | 98 | # NB: Use list comprehension and not a generator so we run all the checks. |
| 96 | return all( | 99 | return all( |
