-
Notifications
You must be signed in to change notification settings - Fork 108
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
Incorrect deep filtering #78
Comments
I'm not sure that is a bug... |
I'm not sure if this is related, but I just found an inconsistency in how node-glob matches paths versus how minimatch matches paths. In node-glob, when a pattern ends with However, it does seem to make more sense in the context of globbing, since the glob is typically matching against the relative part of a (longer) file path. Maybe try doing something lik this on the pattern before passing it to micromatch. if (pattern.slice(-3) === '/**') {
pattern = pattern.slice(0, -3) + '{,/**}';
} It might also be worthwhile comparing some tests to output from node-glob. Not that node-glob is always correct, but it might be informative. |
Hello, @jonschlinkert, First, thanks to a great tip. Yeap, it's a good idea, but this does not apply to the current problem. Unfortunately, this problem also related to issue #80. We exclude directories from reading even if we don't want this. This is related to fast-glob/src/providers/filters/deep.ts Line 46 in e09f2d8
Here we try to exclude the directory from reading using negative patterns. For example, when we provide the I also added more than 300 smoke tests. For more details see #81. I want to close this issue in favour of #80. |
Environment
10.13.3 (macOS)
9.5.0
Actual behaviour
Where we set the
cwd
option, thepackages
path is passed to the depth filter and this is matched to the*
negative pattern. After that, we do not read this directory.If you pass patterns without
cwd
option (likeapp/**/node_modules/**
), then we work withapp/packages
and it's works fine.Expected behaviour
Steps to reproduce
Code sample
The text was updated successfully, but these errors were encountered: