mirror of
https://github.com/semver/semver.git
synced 2026-03-22 05:59:55 -05:00
"[Pre-release] Numeric identifiers MUST NOT include leading zeroes" #121
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @damianpowell on GitHub (Feb 13, 2014).
I can read this two ways:
The distinction is important because it changes how we validate a SemVer string. Under the first approach, we would consider 1.2.3-alpha.012.2 to be invalid, but under the second approach, we would not. However, the sorting applied in approach 2 would consider the second identifier "012" to be an alphanumeric string.
Which is the correct approach, please?
@zafarkhaja commented on GitHub (Feb 13, 2014):
As per the BNF grammar, alphanumeric identifiers must contain at least one non-digit character
Hence,
012cannot be considered as an alphanumeric identifier.@damianpowell commented on GitHub (Feb 13, 2014):
Thanks, @zafarkhaja. The BNF is useful but it's not published on SemVer.org yet so I must assume it's either not finished or intended for a later release of the SemVer specification.
@haacked commented on GitHub (Feb 13, 2014):
It's probably time to update semver.org. But we might want to clarify the text so it's clearer too. Mind submitting PRs?
@tbull commented on GitHub (Feb 14, 2014):
The BNF is a derived work from the spec and (at this time) not normative
by itself.
@FichteFoll commented on GitHub (Aug 28, 2015):
push
This is still an issue with the spec as it's unclear in this regard.
@mkllnk commented on GitHub (Oct 24, 2015):
Just got confused about this as well. You could include a negative example to clarify this.
@FichteFoll commented on GitHub (Nov 3, 2015):
Revisiting this again.
Following the points 9. and 11., the spec seems to indicate that only identifiers with a letter or a hyphen are considered alphanumeric identifiers, leaving numeric identifiers to consist only of numbers. Since 9. prohibits usage of leading zeroes, they are not valid numeric identifiers, thus declaring
1.0.1-alpha.012not to be a semantic version.Case closed, I suppose.
@jwdonahue commented on GitHub (Dec 5, 2017):
@damianpowell, if you have no further questions regarding this issue, please close it at your earliest possible convenience.
@purplexa commented on GitHub (Apr 16, 2018):
Rule 9 should probably explicitly state that a numeric identifier is an identifier which consists of only digits, similar to how rule 10 is explicit about it, since rule 9 comes first.
@jwdonahue commented on GitHub (Jan 17, 2020):
@damianpowell, unless you intend to issue a PR or have further questions, please close this issue at your earliest possible convenience.
Thank you.
@alexandrtovmach commented on GitHub (Jun 10, 2020):
This issue looks staled and will be closed in 10 days if there are no objections. Thanks everyone for contributions, you're amazing 🎆
@alexandrtovmach commented on GitHub (Jun 19, 2020):
👻 👻 👻
Closed as staled