Skip to content

Empty directory / empty file list must exit 1 - #29

Open
forest-savage1234 wants to merge 1 commit into
kchason:mainfrom
forest-savage1234:leftover-c5
Open

Empty directory / empty file list must exit 1#29
forest-savage1234 wants to merge 1 commit into
kchason:mainfrom
forest-savage1234:leftover-c5

Conversation

@forest-savage1234

Copy link
Copy Markdown

Empty directory / empty file list must exit 1

A directory path that yields an empty files list (empty directory, or an extension-filter that matches nothing) still exits 0. The directory branch builds that list with os.listdir, then sets has_failure only inside the validate loop. An empty list never enters the loop, so success stays true.

This packet prints a clear error and sys.exit(1) when files is empty. The CASE 1.4.0 pin stays. The walk stays os.listdir (not recursive). The empty-@context fixture is C6.

Files

  1. entrypoint.py — empty-list check immediately after the os.listdir comprehension.

Out of scope

  • CASE 1.5.0 pin / adding case-1.5.0
  • Recursive directory walk
  • C6 (tests/data/no-context.json)

How to review

The dest is those few lines. Empty dir or miss-filter → error + exit 1. A directory that already has matching files is unchanged.

I am a volunteer. Thank you for the time. I am trying to become more useful on this work, so I welcome a critical look. If this is the wrong cut, or you want me to stand down, say so and I will recut from notes.

Signed-off-by: Forest Savage <forestsavage03@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant