Skip to content
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

Fix behavior for matching paths outside cwd #92

Merged
merged 7 commits into from Apr 24, 2021

Conversation

maximelkin
Copy link
Contributor

@maximelkin maximelkin commented Oct 20, 2019

Fixes #85 (not sure, maybe #87 too)
Here breaking changes:
Old behavior:
all paths, which is outside of current working directory, should be matched only by absolute path glob

New behavior:
you can match dirs outside current working dir
if you want match globally - start glob pattern with /

Removed test "should filter relative paths that leave current directory tree", because of breaking change


IssueHunt Summary

Referenced issues

This pull request has been submitted to:


IssueHunt has been backed by the following sponsors. Become a sponsor

@maximelkin
Copy link
Contributor Author

Should be logic of detecting absolute/relative path go in minimatch instead?

@sindresorhus
Copy link
Owner

Sorry, seems I missed this one.

@sindresorhus
Copy link
Owner

Can you explain exactly what the breaking change is? What used to work and will no longer work (from a user's perspective)?

@maximelkin
Copy link
Contributor Author

I will return to PR in two weeks

@maximelkin maximelkin changed the title fix behavior for matching paths outside cwd WIP: fix behavior for matching paths outside cwd Jul 18, 2020
@sindresorhus
Copy link
Owner

Bump

@maximelkin
Copy link
Contributor Author

maximelkin commented Oct 2, 2020

Got stuck at

minimatch.match('/A/B/C/d.js', '!/**/test.js') -> false
minimatch.match('/A/C/test.js', '!/A/B/**/*.js') -> false

replace **/**/ to **/ in test
@maximelkin
Copy link
Contributor Author

maximelkin commented Oct 6, 2020

Got what, tried to exclude from empty set of files

fix tests with ! only (not matches anything and whats good)
fix behaviour checking test for !** test
also comments
add jsdoc descriptions
small fixes for linter
@maximelkin maximelkin changed the title WIP: fix behavior for matching paths outside cwd fix behavior for matching paths outside cwd Oct 7, 2020
@maximelkin
Copy link
Contributor Author

@sindresorhus described changes in test cases, most of them failing on old version

Base automatically changed from master to main January 23, 2021 11:49
@sindresorhus sindresorhus changed the title fix behavior for matching paths outside cwd Fix behavior for matching paths outside cwd Apr 24, 2021
@sindresorhus sindresorhus merged commit 2e5d663 into sindresorhus:main Apr 24, 2021
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.

Filtering files with paths outside of gulp folder not possible?
2 participants