Skip to content

Consistent handling of directory patterns with trailing slashes in glob patterns #453

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

Merged
merged 4 commits into from
Apr 19, 2025

Conversation

pranshugupta01
Copy link
Contributor

@pranshugupta01 pranshugupta01 commented Apr 4, 2025

This PR fixes an issue where ignore patterns with different formats (**/folder, **/folder/, and /folder//*) weren't being handled consistently.
Changes

  • Enhanced normalizeGlobPattern function to convert **/folder patterns to /folder/
  • This ensures all variants of directory exclusion patterns work identically
  • Added tests to verify the consistent behavior across different pattern formats

Problem Solved
Users previously had to know the exact pattern format to use for ignoring directories. Now all three common formats work as expected, improving usability when excluding directories with patterns like:

  • --ignore "**/bin"
  • --ignore "**/bin/"
  • --ignore "**/bin/**/*"
IMG_7365

Checklist

  • Run npm run test
  • Run npm run lint

@pranshugupta01
Copy link
Contributor Author

Hey @yamadashy PR for fixing #443 and #450

Copy link

codecov bot commented Apr 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.07%. Comparing base (60f32be) to head (4a34439).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #453      +/-   ##
==========================================
+ Coverage   85.04%   85.07%   +0.03%     
==========================================
  Files          87       87              
  Lines        4313     4323      +10     
  Branches      843      848       +5     
==========================================
+ Hits         3668     3678      +10     
  Misses        645      645              

☔ 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.

@pranshugupta01
Copy link
Contributor Author

pranshugupta01 commented Apr 6, 2025

Hey @yamadashy , please look into this PR once you are available

@yamadashy
Copy link
Owner

@pranshugupta01
I apologize for the delayed confirmation! I was on an international business trip and couldn't address this properly.

The implementation is perfect with tests included! I've confirmed it works properly on my end as well.

I'll merge this now.

Looking forward to your future contributions!

@yamadashy yamadashy merged commit 2572260 into yamadashy:main Apr 19, 2025
52 checks passed
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.

2 participants