Support for version constraint wildcards - #3
Open
beornf wants to merge 1 commit into
Open
Conversation
beornf
force-pushed
the
version-wildcard
branch
from
October 22, 2024 08:05
eac47a9 to
63c8286
Compare
Author
|
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, |
knqyf263
reviewed
Oct 22, 2024
knqyf263
left a comment
Collaborator
There was a problem hiding this comment.
We're sorry to miss this PR.
Comment on lines
+133
to
+141
| 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, |
Collaborator
There was a problem hiding this comment.
I'm curious why Parse doesn't fit here.
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Checkwill mutate the object inPessimisticBump,TildeBumpandCaretBump