-
Notifications
You must be signed in to change notification settings - Fork 100
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 wildcards in versions #27
Conversation
Thank you very much, looks good at the first impression, please give me some time to review this, since i'm quite busy in the next couple of days |
Take your time @blang ;) |
@blang Any news on this? :) |
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 finally found some time to look into it, here are a couple of points that caught my attention:
- There are no end2end tests (TestParseRange)
- No full test coverage
- use constants and
iota
for constants:
type wildcardType int
const (
noneWildcard wildcardType = iota
majorWildcard
minorWildcard
patchWildcard
)
// getWildcardType will return the type of wildcard that the | ||
// passed version contains | ||
func getWildcardType(vStr string) wildcardType { | ||
parts := strings.Split(vStr, ".") |
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.
Might not work for prerelease and build metadata version information since it may contain dots like '1.0.0-1.x.x' which is a valid version:
http://semver.org/#spec-item-9
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.
That's only an issue if pr and build metadata versions are allowed as ranges, sadly i haven't written tests for that case in the first place, therefor that's open for discussion
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.
That can't happen as getWildcardType
is executed on each splitted version, meaning that, with your example, getWildcardType
will be called with 1.0.0
and 1.x.x
.
@blang I wrote more tests to push the code coverage to 100% and I wrote end2end tests for the |
LGTM, thanks, good work |
This implements #24
The code will expand wildcards inside versions following these rules: