Fix matching logic for glob hidden files#2130
Merged
Merged
Conversation
thomas-zahner
approved these changes
Apr 13, 2026
Hidden files were always included by glob patterns, even without `--hidden` flag. By default, shell globs exclude hidden files, but lychee behaved differently. The trick is to simply pass `skip_hidden` to glob's`match_opts`. Added two tests to make sure it works as expected: - one test which verifies that `--dump` and `--dump-inputs` with a glob pattern skip hidden files, and - one more test to make sure that `--hidden` makes glob patterns include hidden files
5545493 to
c519bee
Compare
Member
Author
|
Thanks for the fixes @thomas-zahner. 🙂 |
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.
Hidden files were always included by glob patterns, even without
--hiddenflag. By default, shell globs exclude hidden files, but lychee behaved differently.The trick is to pass
skip_hiddento glob'smatch_optsto match shell behavior: wildcards like*and**should not match hidden files/dirs unless--hiddenis passed.Fixes: #1937