You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Generated pre-release part of SemVer differs from SemVer spec #1025
When using SemVer schema and bumping to pre-release version, the version generated is like 1.0.0-a0.
This differs from examples from SemVer spec 9, which is 1.0.0-alpha.0, using "alpha" instead of "a", and having a dot between "a" and the sequential number.
Current behavior may break the version comparison when the number has more than 1 digits.
For example, 1.0.0-a10 is less than 1.0.0-a2 according to spec 11, because a10 is less than a2 lexically.
Steps to reproduce
Setup commitizen using SemVer schema
Run cz bump --pr alpha
Current behavior
Bumped into x.y.z-a0
Desired behavior
Bumped into x.y.z-a.0 or x.y.z-alpha.0
Screenshots
No response
Environment
Commitizen Version: 3.18.3
Python Version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
Operating System: Linux
Note that SemVer2 is underspecified on the prerelease part (I include development releases as the concept does not exist in SemVer2) and some choices has been made, staying close to the examples (only example are using alpha, beta), the specification itself is just about the format and the precedence rules, it does not specify the standard parts (alpha, beta, dev... which might also be a, benddev`).
(This point is one of the reason than Python community dropped SemVer for PEP440)
Activity
woile commentedon Mar 14, 2024
Did you configure the version scheme?
https://commitizen-tools.github.io/commitizen/bump/#version_scheme
Xiangze-Li commentedon Mar 14, 2024
I set this field (when initializing) in
.cz.tomlasversion_scheme = "semver".Actual behavior is exactly same with what stated in the linked manual, which disagrees with SemVer spec.
Xiangze-Li commentedon Mar 14, 2024
I just realized this behavior is OK under SemVer 1.0.0.
Maybe it's nice to seperate the two SemVer more clearly?
woile commentedon Mar 14, 2024
What do you mean by "the two semver"?
Xiangze-Li commentedon Mar 14, 2024
SemVer has two major versions now. Version 2 has changed the spec of the pre-release part.
woile commentedon Mar 14, 2024
mm we may need a new version scheme:
semver_v2Thoughts on this @Lee-W @noirbizarre ?
krumlo commentedon Apr 17, 2024
Second this, I'd really enjoy semver 2.0 support!
noirbizarre commentedon Apr 17, 2024
Hum, makes sense.
I need to review quickly differences with v1, but it should be easy with the versioon providers
feat(schemes): adds support for SemVer 2.0 (dot in pre-releases) (fix c…
feat(schemes): adds support for SemVer 2.0 (dot in pre-releases) (fix c…
feat(schemes): adds support for SemVer 2.0 (dot in pre-releases) (fix c…
noirbizarre commentedon Apr 18, 2024
There it is, implemented in #1072.
Note that SemVer2 is underspecified on the
prereleasepart (I include development releases as the concept does not exist in SemVer2) and some choices has been made, staying close to the examples (only example are usingalpha,beta), the specification itself is just about the format and the precedence rules, it does not specify the standard parts (alpha,beta, dev... which might also bea,benddev`).(This point is one of the reason than Python community dropped SemVer for PEP440)
feat(schemes): adds support for SemVer 2.0 (dot in pre-releases) (fix c…
feat(schemes): adds support for SemVer 2.0 (dot in pre-releases) (fix c…
feat(schemes): adds support for SemVer 2.0 (dot in pre-releases) (fix #…
Xiangze-Li commentedon Apr 18, 2024
Many thanks!
krumlo commentedon Apr 18, 2024
@noirbizarre very quick feedback, thanks a bunch!!