-
Notifications
You must be signed in to change notification settings - Fork 14
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
Support for version constraint wildcards #3
base: main
Are you sure you want to change the base?
Conversation
eac47a9
to
63c8286
Compare
I have reworked this PR so there are no breaking changes to existing test cases. I have also added support for range constraints for example, |
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.
We're sorry to miss this PR.
var segments []part.Part | ||
for _, str := range strings.Split(m[3], ".") { | ||
segments = append(segments, part.NewPart(str)) | ||
} | ||
|
||
v := Version{ | ||
segments: segments, | ||
preRelease: part.NewParts(m[6]), | ||
original: c, |
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.
I'm curious why Parse
doesn't fit here.
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.
If we use Parse
from version.go
here that means a valid version would be 1.2.x
. So instead it's necessary to parse the segments here to create a valid "constraint" version.
I discovered you started a library after commenting on my PR at hashicorp/go-version#49. I've written this PR which adds support for version wildcards and passes all https://github.com/Masterminds/semver test cases.
This also addresses a few issues:
Check
will mutate the object inPessimisticBump
,TildeBump
andCaretBump