-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Clarify version property pattern in schema.json #12332
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
Conversation
Thanks yeah I was trying to keep this short for simplicity but if it causes problems it's worth expanding it 👍🏻 |
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.
Braaavooo 😂💥
@changeschung the only way to never break anything is to stop moving forward. Shit happens, no reason to make fun of people. |
Oops... It looks like the version format is actually more flexible than what’s in the docs. Ideally, we should update them to avoid confusion — though nailing down the exact wording might be a little tricky. |
And when did I? Where did I? Dude? |
R u on drugs? |
Yeah I don't really want to document all the horrible formats people use to avoid promoting them, but we do have to support them for BC reasons :) |
This PR broke repositories with type |
@dbpolito In what way does it break using path repositories? It’s probably best to open a new issue with some details about what you observe under what circumstances. |
Yeah that is a good improvement tho, it caught a misconfiguration. |
Hello, Since installation of Composer 2.8.8 I get this error when running composer diagnose:
How can I get rid of this FAIL ? I tried looking for 'packages[121].version' string and substring in the composer .lock file but did not find anything matching. Where is the fault and how can I fix it ? I have the same erron on another site with 'packages[110].version' |
Maybe that's related to #12376 not being released yet. Does the issue persist when updating Composer with |
I cannot self-update composer, it is managed by the provider ... I'll have to wait for them to update composer :( The issue is not occuring on any of my local sites ... |
Ok https://github.com/composer/composer/releases/tag/2.8.9 is now out sorry for the delay. |
Motivation
The primary reason for these changes is to attempt a workaround for an annoying bug in JetBrains' IDE.
Background
I create private packages that are distributed via archives (using the
artifact
repository type). As a result, I need to specify theversion
of the packages directly in thecomposer.json
file.What's wrong
PhpStorm considers the version
1.0.0-dev
as invalid, displaying the error: "String violates the pattern: '^v?\d+(.\d+){0,3}|^dev-'".In my opinion, the reason for this behavior is an incorrect implementation of the pattern matcher:
https://github.com/JetBrains/intellij-community/blob/33099feb7000ed4f798ba3f34fd28c08518c96cf/json/src/com/jetbrains/jsonSchema/impl/light/legacy/JsonSchemaObjectReadingUtils.java#L355-L386
matches()
method (which attempts to match the entire region against the pattern) instead offind()
.adaptSchemaPattern()
method, which "adapts" the original pattern and is incompatible with alternation (such as^v?\d+(\.\d+){0,3}|^dev-
).Solution
^...$
.