-
-
Notifications
You must be signed in to change notification settings - Fork 281
Unclear documentation regarding bump_map
#395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey thanks for the finding, I think we should fix the docs, but it also looks like a bug. In the meanwhile you can write the questions, or write a custom cz class to by-pass the issue, sorry. |
Yes, that's correct. There's no way can support the full functionality through
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "v$major.$minor.$patch$prerelease"
update_changelog_on_bump = true
version = "0.3.2"
bump_map = {break = "MINOR", new = "PATCH", fix = "PATCH", hotfix = "PATCH"}
Edit: I just found out this is not yet supported as well, but I think it much easier to add than supporting filter for cz_customize
Could you kindly point out where do you think are the best places to add these links? We're open to pull request as well 🙂 |
I don't think we need default questions for
I think this is how this kind of issue should be solved. |
Thank you both for your replies! So I think that, in order to use I'm really a newbie to Commitizen, so I have no clue as to where to start fixing this. I am very willing to help, though, so any guidance is appreciated here 😁 @woile Also, you mentioned that The docs mention that
could you provide an example for this? How would different |
The error can be handled at either commitizen/cz/customize/customize.py#L40 or commitizen/commands/commit.py. As for the new feature, I think the idea is to load the configuration from commitizen/config/base_config.py to commitizen/cz/conventional_commits/conventional_commits.py. It seems both we are quite busy these days 😞 But we'd be happy to provide help if you're interested in submitting a pull request 🙂 |
I have the same issue as above. just wish to customize one part, the bump map. but doing just this causes the other issue as pointed out above, use the defaults if the setting is not available my commitizen:
bump_message: "style(Version): bump version $current_version \u2192 $new_version"
changelog_incremental: false
tag_format: v$major.$minor.$patch$prerelease
update_changelog_on_bump: true
version: 0.1.0
name: cz_customize
customize:
bump_pattern: "^(break|new|fix|hotfix|ci|docs)"
bump_map:
break: MAJOR
new: MINOR
fix: PATCH
hotfix: PATCH
ci: PATCH
docs: PATCH with the custom settings neither changelog or cz commit works anymore. error from (dev_env) $ cz commit
Traceback (most recent call last):
File "/home/username/tmp/ansible-roles/dev_env/bin/cz", line 8, in <module>
sys.exit(main())
File "/home/username/tmp/ansible-roles/dev_env/lib/python3.6/site-packages/commitizen/cli.py", line 301, in main
args.func(conf, vars(args))()
File "/home/username/tmp/ansible-roles/dev_env/lib/python3.6/site-packages/commitizen/commands/commit.py", line 72, in __call__
m = self.prompt_commit_questions()
File "/home/username/tmp/ansible-roles/dev_env/lib/python3.6/site-packages/commitizen/commands/commit.py", line 50, in prompt_commit_questions
answers = questionary.prompt(questions, style=cz.style)
File "/home/username/tmp/ansible-roles/dev_env/lib/python3.6/site-packages/questionary/prompt.py", line 68, in prompt
return unsafe_prompt(questions, answers, patch_stdout, true_color, **kwargs)
File "/home/username/tmp/ansible-roles/dev_env/lib/python3.6/site-packages/questionary/prompt.py", line 132, in unsafe_prompt
for question_config in questions:
TypeError: 'NoneType' object is not iterable
(dev_env) $ |
Yes, the problem is that we do not have default questions as of now. We're planning on make cz rules (e.g., conventional commit) customizable but will most likely keep |
@Lee-W when I do the customize config like this:
And I have a commit like "ci: changed ci". Then when I run |
@xytian315 you have to create a python module. please see this module on how I did it. I added |
Type
URL
https://commitizen-tools.github.io/commitizen/customization.html#1-customize-in-configuration-file
TL;DR
How can I configure Commitizen in a
pyproject.toml
to fix the MAJOR version as 0, increment MINOR on breaking changes and PATCH on any other change as simply as possible?Description
I am working on a project in early-stage development. In this case, breaking changes happen more often than not. So, to flag this situation, we are using the following convention: the version number is always
0.y.z
(which is consistent with SemVer). We incrementy
when breaking changes happen, andz
whenever we introduce new features and bug fixes.To achieve this, I wrote the following configuration in our
pyproject.toml
:This seemed pretty straightforward, but, to my surprise, it didn't work. This is what I got after introducing breaking changes to the code:
whereas desired behaviour is to get
Well, of course it doesn't work. According to the linked docs, the
bump_map
configuration should be included in a[tool.commitizen.customize]
section of the configuration file. But then I tried this:This almost works (note that now the detected change is "PATCH", but it should be "MINOR"):
but the problem is that now committing does not work anymore:
But then this raised some questions, which are unanswered in the docs:
bump_map
? Did I write this part of the configuration correctly?cz c
is due to the fact that I didn't provide[[tool.commitizen.customize.questions]]
. If that's it, how can I provide such sections so thatcz c
behaves just like before (with the same questions and same options)?[[tool.commitizen.customize.questions]]
? It seems to me that customizingbump_map
should "just work" in the[tool.commitizen]
section.pyproject.toml
configuration file to achieve the desired behaviour as simply as possible, without writing[[tool.commitizen.customize.questions]]
sections?I am marking this as a "documentation" issue since it isn't clear to me from the docs if the behaviour I want is even possible, and, if so, how to get it to work.
The text was updated successfully, but these errors were encountered: