-
Notifications
You must be signed in to change notification settings - Fork 658
fix(fs): expandGlob
/expandGlobSync
- match non-glob path segments containing escaped glob chars
#6788
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
base: main
Are you sure you want to change the base?
Conversation
expandGlob
/expandGlobSync
- match non-glob path segments containing escaped glob chars
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6788 +/- ##
==========================================
- Coverage 94.09% 94.08% -0.01%
==========================================
Files 578 578
Lines 42633 42655 +22
Branches 6779 6782 +3
==========================================
+ Hits 40114 40134 +20
- Misses 2468 2470 +2
Partials 51 51 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
LGTM. Thanks!
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.
Pull Request Overview
This PR fixes an issue where expandGlob
and expandGlobSync
functions were not properly handling escaped glob characters in non-glob path segments. The fix ensures that when path segments contain escaped glob characters (like \[
or \]
), they are correctly unescaped when building the fixed root path.
- Added
unescapeGlobSegment
helper function to remove escape characters from path segments - Updated both
expandGlob
andexpandGlobSync
to unescape non-glob segments before joining them to the fixed root - Added comprehensive tests for both async and sync versions with escaped bracket scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
fs/expand_glob.ts | Implements the core fix by adding unescaping logic for non-glob path segments |
fs/expand_glob_test.ts | Adds test cases to verify escaped bracket handling in directory names |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@kt3k I updated this PR based on the AI feedback. It was too simplistic before I think |
Closes #6787