Replies: 2 comments 8 replies
-
I think #720 addresses all of this. |
Beta Was this translation helpful? Give feedback.
-
Hi @adamralph. I've written a SemVer parser I am about to release soon. It is 100% restrictive and customizable when one of these restrictions are hit. Would you be interested in it? Here the parser and tests: You can easily use like I did here in my version class: https://github.com/Teneko-NET-Tools/Teneko.VersionableMessages/blob/main/src/Teneko.VersionableMessages.SemVer/SemanticVersion.cs |
Beta Was this translation helpful? Give feedback.
-
Currently, leading zeros are removed from the major, minor and patch parts, but they are preserved in pre-release identifiers.
For example, the tag
01.02.03-beta.0004
is parsed as version1.2.3-beta.0004
. This doesn't feel right. It seems logical to either parse as version01.02.03-beta.0004
(preserving all leading zeros) or as version1.2.3-beta.4
(preserving no leading zeros).But that leads into a wider question: both convention and SemVer 2.0 put restrictions on which characters can and can't be in a specific version part. I cannot recall seeing anyone using leading zeros in major, minor, or patch parts, and SemVer disallows it, which generally makes it "OK" that MinVer strips out those leading zeros. So effectively, MinVer is restricting the version to some parts of SemVer (and general convention), and transforming some parts of the version to comply on the consumer's behalf. This also feels off. It should either be completely restrictive, or completely unrestrictive (possibly with an option to switch modes). And if it is restrictive, what better standard to use than SemVer? Also, what does "completely unrestrictive" mean? There would probably still have to be some restrictions, and not just free text.
I'm capturing this in a discussion for now because I'm not sure whether this discussion is going to reveal bugs or features, nor how many of each. There may also be two (or more) separate concerns here but I can't disentangle them yet.
Thanks to @bording for bringing this to my attention.
Beta Was this translation helpful? Give feedback.
All reactions