Allow multiple star-star globs in one pattern#20639
Merged
Merged
Conversation
ca029c7 to
ea8157e
Compare
ghost
reviewed
Dec 12, 2017
| it("can include dirs whose pattern starts with **", () => { | ||
| const json = { | ||
| include: [ | ||
| "**/x" |
There was a problem hiding this comment.
If we use **/x/**/y will it include /a/x/b/y/c/z.ts?
ghost
approved these changes
Dec 12, 2017
sheetalkamat
approved these changes
Dec 13, 2017
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #16115
The original issue was because when we saw a pattern like
/foo, we appended/**/*to the end to build a correct regex. Now, if the input pattern was**/foo, we'd do the same (with no error, since there weren't multiple star-star globs in the original pattern), except then we'd bail out on manufacturing the regex when we saw there were multiple**patterns (since we added/**/*to the end).Now, I can't figure out why you'd forbid multiple
**'s in a glob pattern in the first place (node-globandbashseem to handle it just fine), so I just removed the restriction (and the early-bail clause in the regex generation code). I looked at the history, and the restriction's been in place since @rbuckton 's first iteration of the feature, so I think that it's still here was just a holdover from before we built a regex from the pattern.Everything that's not a change to the tests in this PR is just removing lines of code, so this seems like a pretty good change!