-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Be more strict with Composer version constraints #756
Conversation
Codecov Report
@@ Coverage Diff @@
## main #756 +/- ##
============================================
+ Coverage 97.40% 97.44% +0.04%
- Complexity 162 166 +4
============================================
Files 30 30
Lines 693 705 +12
============================================
+ Hits 675 687 +12
Misses 18 18
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@localheinz is there anything I can do to help get this merged in? I'm happy to split this into individual pull requests if you'd prefer to evaluate each item separately. |
I've resolved the merge conflict with a merge commit. Please let me know if you'd prefer a re-base. |
Since I made a bunch of changes in |
Yes, that's fine with me. I'm happy to update this pull request, but probably won't have capacity to do so for a few days at least. |
@localheinz I've merged in the changes from Also, I noticed that the sentences used for version constraints are now all messed up. I decided to leave this as-is, as these are nonsense version constraints, so having nonsense come out seems fine to me. For example, Line 9 in 1bc7e57
|
I missed this when merging another branch into this. Eventually this branch will need a changelog entry too.
I like this change, but I am going to prepare a release for |
Since it might be subject to debate, what about using configuration for this ? Something like "preferred operator" or "min part number" ? |
@localheinz this pull request came up in discussion with a colleague today. Is there anything I can do to help progress this? |
I am removing the adjustments for parts (for now), because I am a bit unsure whether people will like it or not. I certainly would, but I am in favour of three instead of two parts, so |
f6f7616
to
8631af0
Compare
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.
👍
Thank you, @fredden! |
Thanks very much for considering these features. I've seen benefit from those that were released as part of v4.0.0 already, and I look forward to those that have been released now too. I'll leave the idea about min/max 'parts' with you; let me know if you'd like me to open a pull request for that feature. |
Thank you very much, @fredden - I still have a backup of your branch, so I will open a pull request soon! |
This pull request changes the Composer version constraint normalisation to be more opinionated / strict.
Please let me know if you would prefer to have these enhancements as individual / separate pull requests. It may be that some of these rules are desired whereas others are too subjective / opinionated for now.
Changes include:
*and- constraints are always separated by a single space (
), never a comma (Always use a single space for,
)and
combinator #819overlapping constraints are removed (Remove overlapping constraints #850^1.0 || ^1.1 || ^2.0
->^1.0 || ^2.0
)1.0.*
->~1.0.0
)~1
->^1
,~1.3
->^1.3
)^1
->^1.0
)^1.0.0
->^1.0
)version numbers are sorted in ascending order (Sort version numbers in ascending order #816^2.0 || ^1.4
->^1.4 || ^2.0
)