-
-
Notifications
You must be signed in to change notification settings - Fork 188
solved: Regression from v3: matches that used to work no longer do #133
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
Comments
Hi @Vinnl, thanks for the issue.
Indeed, the changelog is wrong. This is my reminder to update our very neglected changelog, I'm sorry for the inconvenience that caused. Regarding the actual issue, since I haven't seen any details that lend insight into where and how the patterns are handled etc. (only that it's "not matching"), I'm going to make a leap and assume that it's related to the most "obvious" thing that comes to mind for me: handling of windows backslashes. My hunch is that TLDR; This looks like a regression, but we made an intentional necessary change in v3.0 that unfortunately was left out of the changelog but is well documented in the readme. Here is the bottom line of the changes:
If it turns out that the problem was related to something else, we'll pretend I didn't write all of this and I'll just move it over to our neglected changelog so that I can just start calling it our "changelog" ;) |
It's a bit hard for me to diagnose as well since it happened inside on of my dependencies (i.e. Jest), but if by "window backslashes" you meant "Windows backslashes" - if that's the case, then Jest should have been doing something with my glob pattern. I'm running on Linux, and did not escape any paths. If helpful, my glob patterns were defined here. Of course, addressing issues is perfectly understandable :) In any case, thanks for the project :) |
typo, fixed.
Hmm, something else is going on then. I'm still thinking it's related to joining globs, but I'm not sure what specifically. I'll try to look into it. Thanks for the additional info. |
Fwiw, to clarify (even though it doesn't really pertain to you since you're not using Windows) it's more related to something like this: On Windows, that would result in something like Where/when are the errors occuring? Locally, or on a service like Appveyor? |
For me, I encountered the errors both locally and running in GitLab CI/CD - both on Linux. That said, there were quite a few others in that bug report that encountered it too, and I don't know where they encountered it. Of course it's perfectly possible that it happens somewhere in the interaction with Jest, but I just noticed that you are present in their issue tracker already, so they'll probably be able to tell you more about that. |
Here's a test case demonstrating the difference of behavior between versions: A couple opinions here:
My uname: |
ah, all three of those patterns are invalid globs.
|
Totally agreed -- I think the issue is just that this change in behavior isn't mentioned in the CHANGELOG. I think even: "v3 handling of glob is more strict, so some invalid expressions which worked in v2 may no longer function" would suffice, though if we know precisely what changed (which would be hard, since v3 was cut so long ago) that would be better. |
If you think about it, that doesn't really make a lot of sense, since there are an infinite number of patterns that don't work, and only a finite number of patterns that do. The only patterns this library ever had a "contract" to match with was valid patterns. IMHO, it's not a bug or a regression that the newest version of micromatch makes user errors more obvious. edit: to be clear, v3 isn't "more strict", it's more accurate. So maybe I should add something like "Since v3 is more accurate than previous versions, it's possible that invalid patterns that worked in the past will no longer work"? |
Add CHANGELOG for version 3, fixes #133
I'm upgrading to |
The changelog says
Hence this issue :)
Please describe the minimum necessary steps to reproduce this issue:
Matches that used to work in
micromatch@2
no longer do inmicromatch@3
. I'm not sure exactly in what cases, but it would be good to mention them in the CHANGELOG.It's explained in more detail at jestjs/jest#6563 (comment), but e.g.
src/**/*.{js}
should now besrc/**/*.js
, andsrc/**.js
should now besrc/**/*.js
. There might be more changed matches that I don't know of.What is happening (but shouldn't):
The CHANGELOG mentions no breaking changes.
What should be happening instead?
The CHANGELOG could mention which globs no longer work, and how they could be changed to work again.
The text was updated successfully, but these errors were encountered: