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.
This PR replaces the regex backend with an in-house glob parser.
The parser is two-pass:
Pattern
then walks through a given file path and returns the result.By avoiding regex we mainly avoid to fall victim of unescaped characters that may compromise globbing. We probably also increase performance, but I haven't run any benchmark and it'd be likely a negligible advantage, since file paths are short strings.
Extensive testing is very welcome. Ideally, we should fuzzy testing this too.
Limitations
[abcd]
). It only supports*
and?
.*
wouldn't be useful, but two consecutive?
may be. Should such need arise, I'll work on supporting it.