Skip to content

Generated pre-release part of SemVer differs from SemVer spec #1025

Description

@Xiangze-Li

Description

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

  1. Setup commitizen using SemVer schema
  2. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions