Skip to content

fix(Glob): multiple separated brace pairs#17516

Merged
Jarred-Sumner merged 7 commits intomainfrom
dylan/fix-glob-regression
Feb 21, 2025
Merged

fix(Glob): multiple separated brace pairs#17516
Jarred-Sumner merged 7 commits intomainfrom
dylan/fix-glob-regression

Conversation

@dylan-conway
Copy link
Copy Markdown
Member

@dylan-conway dylan-conway commented Feb 21, 2025

What does this PR do?

fixes #17512

  • fixes bugs in patterns with non-nested brace pairs with trailing characters, e.g. "{a,b}/c/{d,e}/**/*est.ts" with input "a/c/d/one/two/three.test.ts".

  • fixes bugs with **/ at the beginning of patterns in braces, e.g. "{**/a,**/b}" with input "b".

How did you verify your code works?

Added a test with patterns from #17512

@robobun
Copy link
Copy Markdown
Collaborator

robobun commented Feb 21, 2025

Updated 2:28 AM PT - Feb 21st, 2025

@dylan-conway, your commit 9649b53 has 1 failures in Build #11997:


🧪   try this PR locally:

bunx bun-pr 17516

@dylan-conway
Copy link
Copy Markdown
Member Author

@brynne8 with this change, each pattern from your test matches exactly the expected count except for the last pattern "extensions/**/{browser,common,node}/{**/*[sS]ervice*,**/*[pP]rovider*}.ts" which continues to match 0 paths.

@brynne8
Copy link
Copy Markdown

brynne8 commented Feb 21, 2025

@brynne8 with this change, each pattern from your test matches exactly the expected count except for the last pattern "extensions/**/{browser,common,node}/{**/*[sS]ervice*,**/*[pP]rovider*}.ts" which continues to match 0 paths.

Wow. That's great. But why is the last pattern continues to match 0 paths? Is that because there's complex pattern (with globstar and stars) in braces?

@dylan-conway
Copy link
Copy Markdown
Member Author

But why is the last pattern continues to match 0 paths? Is that because there's complex pattern (with globstar and stars) in braces?

There was a bug matching **/ inside {}. I've pushed a fix, now the last pattern matches 3 times with "extensions/github-authentication/src/common/experimentationService.ts", "extensions/microsoft-authentication/src/browser/authProvider.ts", and "extensions/microsoft-authentication/src/node/authProvider.ts"

@Jarred-Sumner Jarred-Sumner merged commit fbc4aa4 into main Feb 21, 2025
68 of 70 checks passed
@Jarred-Sumner Jarred-Sumner deleted the dylan/fix-glob-regression branch February 21, 2025 18:54
Jarred-Sumner pushed a commit that referenced this pull request Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent Glob Pattern Matching Results in Bun 1.2.2 and 1.2.3-canary

4 participants