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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add more general support for negated exclude rules #58
Conversation
Seems good! I think this addresses the issues I raised. One quick question - this logic seems somewhat complex (lots of double negatives), and it seems like the micromatch library supports all this logic directly via negated patterns. Why not just have a single array of |
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.
@davewasmer @bcoe I tried taking a different crack at this briefly over the weekend but unfortunately to support all the use cases we want, I ended up with something similarly complex...
I am ok with merging this, but I too am not a fan TBPH.
@davewasmer I can't quite figure out how to support this elegantly with the The problem is that if you have an include pattern like |
@davewasmer might be worth having an extra set of eyes on the |
I think if you don't use > mm('foo/bar.js', [ 'foo/**', '!foo/**' ])
[] |
@davewasmer want to submit a patch to this branch 馃槃 just added you to the project. |
Nothing like trying to implement it to help you find the flaws. The critical shortcoming of the micromatch API is that if a filepath matches any negation, it's excluded no matter what. This means that it's impossible to do an "exclude everything except" type of pattern:
Which is actually the exact use case that led me to find this issue in the first place. Nevermind then 馃槈 |
@davewasmer sounds like we need to stick with my wonky logic for now? |
@davewasmer how does this look? very much appreciate the failing tests 馃憤