Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Breaking versions in cz bump #1360

Unanswered
radeklat asked this question in Q&A
Discussion options

Hello 👋

The conventional commit message format allows for different ways of specifying breaking changes:

  1. BREAKING CHANGE: a commit that has a footer BREAKING CHANGE:, or appends a ! after the type/scope, introduces a breaking API change (correlating with MAJOR in Semantic Versioning). A BREAKING CHANGE can be part of commits of any type.

However, I can't figure out how to use this in cz bump. It looks like I can use only the type to drive the version number changes. Example pyproject.toml config:

[tool.commitizen]
name = "cz_custom"
tag_format = "$version"
version_scheme = "semver2"
version_provider = "poetry"
update_changelog_on_bump = true
[tool.commitizen.custom]
message_template = "{{change_type}}{% if scope %}({{scope}})){% endif %}{% if breaking %}!{% endif %}: {{description}}{% if body %}\n\n{{body}}{% endif %}"
schema_pattern = "(feat|fix|build|chore|ci|docs|style|refactor|perf|test)(\\([^:]+\\))?(!)?:(\\s.*)"
bump_pattern = "^(feat|fix|style|refactor|perf)(:?\\([^:]+\\))?(!)?"
bump_map = {"!" = "MAJOR", "feat" = "MINOR", "fix" = "PATCH", "style" = "PATCH", "refactor" = "PATCH", "perf" = "PATCH"}

As far as I can tell, bump_map read only the first match. So even if I specify feat!, it doesn't pick it up. The same goes for the BREAKING CHANGE footer.

Is this way of specifying breaking changes even supported or would I have to diverge from the standard and use a breaking kind of type instead?

I read through the entire documentation, searched existing issues and discussions and was not able to find any answers.

Thank you.

You must be logged in to vote

Replies: 1 comment

Comment options

Having the same issue, couldn't find out how to configure it to firstly look if commit message doesn't contain ! after type specification.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /