Skip to content

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Aug 9, 2025

Closes #6787

@dsherret dsherret requested a review from kt3k as a code owner August 9, 2025 14:49
@github-actions github-actions bot added the fs label Aug 9, 2025
@dsherret dsherret changed the title fix(fs/expand-glob): match non-glob path segments containing escaped glob chars fix(fs): expandGlob/expandGlobSync - match non-glob path segments containing escaped glob chars Aug 9, 2025
Copy link

codecov bot commented Aug 9, 2025

Codecov Report

❌ Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.08%. Comparing base (b8959a5) to head (aeb6e6a).

Files with missing lines Patch % Lines
fs/expand_glob.ts 95.83% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@dsherret dsherret requested a review from Copilot October 17, 2025 14:47
Copy link

@Copilot Copilot AI left a 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 and expandGlobSync 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.

@dsherret dsherret requested a review from kt3k October 17, 2025 15:00
@dsherret
Copy link
Member Author

@kt3k I updated this PR based on the AI feedback. It was too simplistic before I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

expandGlob/expandGlobSync does not handle escaped paths well

2 participants