-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow globs to be passed into yek
#111
Merged
Conversation
This file contains 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
Expanded glob patterns into file and directory lists before processing. Added process_files_parallel_internal to handle directory recursion separately.
- Add test_glob_pattern_single_file to verify single file matching - Add test_glob_pattern_multiple_files to test multiple file matching - Add test_glob_pattern_nested_directories to test recursive glob patterns - Add test_glob_pattern_no_matches to verify empty result handling - Fix relative path comparisons in tests
- Fix String::from_utf8 call in test_output_dir to properly handle ownership - Fix glob pattern handling in test_glob_pattern by using current_dir - Fix directory handling in test_mix_of_files_and_dirs by using current_dir - Fix glob pattern and directory handling in test_mix_of_files_and_dirs_with_glob_pattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR adds glob pattern support to the yek tool, enabling file selection using patterns like *.rs
for more flexible file matching.
- Added glob pattern expansion in
src/parallel.rs
with proper handling for single files, directories, and multiple patterns - Introduced comprehensive test coverage in
tests/e2e_test.rs
for glob pattern matching scenarios - Added test cases in
tests/parallel_test.rs
for nested directory traversal and edge cases - Changed String::from_utf8_lossy to String::from_utf8 in test code for more explicit error handling
- Split directory processing logic in
process_files_parallel
for better maintainability
4 file(s) reviewed, 5 comment(s)
Edit PR Review Bot Settings | Greptile
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
- Add glob pattern support to feature list - Add examples for using glob patterns and individual file selection - Include note about quoting glob patterns to prevent shell expansion
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.
e.g.
yek *.rs