-
Notifications
You must be signed in to change notification settings - Fork 20
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
semver module: missing MINOR, PATCH should not be ignored #17
Comments
There is also the question of how blatantly invalid semvers are handled; e.g., " |
I think I'm going to do some work on the module adding the official regular expression to check for validity. A |
I think that is a good idea. Note that a leading "v" was valid in SemVer 1.0.0 but is invalid in the 2.0.0 spec. No idea why that change was made but even if it is a good idea for the SemVer spec I think a "v" prefix should be silently ignored if the string is otherwise valid. That is, always preface the official regexp with |
Rewrite of the parsing code to use the official semver regex and to improve the algorithm, both according to the spec. This fixes #16 and #17. Changes: - New function semver:validate which throws an exception for invalid version strings. - New function semver:parse which returns a map containing the parts of a valid version string. Uses semver:validate automatically. - The main semver:cmp function now ignores the build metadata, if present. - All validation, parsing and comparison functions now can take an &allow-v option which allows a "v" or "V" at the beginning without raising an error (this is not part of the spec but it's common use). The default behavior can be set by assigning to `$semver:allow-v-default`.
@krader1961 please check out #18. |
I think #18 addresses this issue, so I'm closing it. @krader1961 feel free to reopen if there's something still missing. |
(Reported by @krader1961)
According to the documentation:
Currently semver considers missing Y or Z as zeros, so that:
This should produce an error - maybe there should be a
&non-strict
option to allow parsing non-strictly-compliant numbers.The text was updated successfully, but these errors were encountered: