fix(find): prevent silent false negatives#2996
Draft
coyaSONG wants to merge 1 commit into
Draft
Conversation
Signed-off-by: coyaSONG <66289470+coyaSONG@users.noreply.github.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.
Summary
findvisibility for hidden and gitignored entries.Closes #2995.
Root cause and impact
The walker stripped the search root from every result and discarded the resulting empty path, so an explicitly requested file or directory disappeared. RTK syntax also treated a lone existing path as a basename glob, while native-flag syntax still applied RTK's ignore-aware pruning. Finally, the zero-result branch returned without output. Together these paths produced silent false negatives with exit code 0.
Native-flag syntax now disables hidden and ignore-file pruning, while compact RTK syntax retains its existing pruning behavior. An explicit second positional search root still wins over path auto-detection, preserving inputs such as
rtk find . src.Test plan
cargo fmt --all && cargo clippy --all-targets && cargo testrtk find ./journal.md -type f, bare file roots, directory roots, native hidden/gitignored matches, compact pruning, and zero-match output inspectedThe full suite passed with 2,437 unit tests and all integration test binaries green (8 tests ignored by the repository).