Repository navigation
Allow empty file lists with --allow-no-files - #135
Merged
Merged
Conversation
|
Is this ready to be merged? |
JeffFaer
requested changes
Oct 29, 2026
JeffFaer
approved these changes
Oct 31, 2026
JeffFaer
left a comment
Collaborator
There was a problem hiding this comment.
thanks for bearing with me!
Collaborator
|
@KatrinaHoffert huh, looks like I'm not allowed to approve PRs anymore? I guess I can't say I'm surprised but that is a little bit of a bummer Can you allow the workflows to run on this? |
Member
|
@JeffFaer I can, but let me first see if I can get you added back as a maintainer. Sent a request. Please give that a try and let me know if it doesn't work (as then I'll review myself). |
Collaborator
|
It worked! |
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.
Hooks can invoke keep-sorted with an empty file list when a commit only deletes files. Add the opt-in
--allow-no-filesflag requested in #134 so that an empty invocation can succeed silently. Default no-files rejection, configuration validation and processing of supplied files remain unchanged. The README documents the hook use case.As requested in review, the tests now isolate
Rundispatch with an operation spy. Eight cases verify default rejection, opt-in success without calling the operation, configuration validation, named-file/stdin forwarding, and operation result/error propagation. There is no filesystem or standard-stream orchestration in this test. Existing golden integration tests still exercise the real operations. This review update changes onlycmd/cmd_test.go; production code and README are unchanged.Validation: Go1.23.12 full tests/goldens, vet, build, formatting and repository pre-commit checks pass locally. Two controlled mutations fail the relevant unit case: removing empty-file acceptance, and incorrectly invoking the operation for an enabled empty list. The restored source passes.
Exact-source fork validation passes all four jobs: full tests, build, vet and format on Linux, Windows and macOS, plus Linux pre-commit. All eight unit cases pass on each OS. Tested source
a2ca9be5ff7fcc5a2b75a9822274ccd4ea418cf9, current targetb225c42a9a8f480d760cf967d1e3a839060b242c, separate workflow revision4ca6a101833faf0b43c4555d885f09a363bdda56. Fork validation configuration is outside this contribution diff.Fixes #134.