From fbcec8fdb07e7dc7f0714af08aa59edb5001fbcb Mon Sep 17 00:00:00 2001 From: Forest Savage Date: Mon, 24 Aug 2026 03:31:41 -0800 Subject: [PATCH] Empty directory / empty file list must exit 1 Signed-off-by: Forest Savage --- entrypoint.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/entrypoint.py b/entrypoint.py index 463808d..5380753 100644 --- a/entrypoint.py +++ b/entrypoint.py @@ -110,6 +110,18 @@ def annotate_pr(message: str) -> None: if f.endswith(extension_filter) ] + if not files: + if extension_filter: + print( + f"Error: {case_path} is a directory but no files matched " + f"extension filter {extension_filter!r}." + ) + else: + print( + f"Error: {case_path} is a directory but it contains no files to validate." + ) + sys.exit(1) + print(f"Validating {len(files)} files at: {case_path}") # Loop through each file and validate it has_failure: bool = False