Empty directory / empty file list must exit 1 - #29
Open
forest-savage1234 wants to merge 1 commit into
Open
Conversation
Signed-off-by: Forest Savage <forestsavage03@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Empty directory / empty file list must exit 1
A directory path that yields an empty
fileslist (empty directory, or anextension-filterthat matches nothing) still exits 0. The directory branch builds that list withos.listdir, then setshas_failureonly inside the validate loop. An empty list never enters the loop, sosuccessstays true.This packet prints a clear error and
sys.exit(1)whenfilesis empty. The CASE 1.4.0 pin stays. The walk staysos.listdir(not recursive). The empty-@contextfixture is C6.Files
entrypoint.py— empty-list check immediately after theos.listdircomprehension.Out of scope
case-1.5.0tests/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.