-
-
Notifications
You must be signed in to change notification settings - Fork 281
Allow multiline commit messages when using a custom .cz.toml #264
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
Probably we should add some notes to the prompt information? If it is possible, please feel free to assign this issue to me. |
Yes, we definitely should improve the message. Thanks for your help 🙂 I'm not sure the idea of the quote is what we wanted. What is the expected behavior if we have a |
I'm neutral to this one since multiple-line does not bother me at all recently haha. I'm curious whether there's tool that can help us make this |
Yeah, I also have concern about it. I should make some survey. |
I assume this is something that needs to be configured manually if you're using a customized config? That's what I'm doing, and the |
@FelixAbrahamsson Yes, it uses the filter here |
Right, that's what I was trying to do with the |
I think custom class configuration should work in this case |
Wouldn't it just be possible to work with a proper heredoc for this? |
I was also curious about this feature and I did a little bit of digging around and found that Questionary was used to prompt the user to input commit information. So I had a look at Questionary and it looks like there's an option to enable multiline input there! Relevant Questionary docs: https://questionary.readthedocs.io/en/stable/pages/types.html#type-text @Lee-W Do you think it would be possible to use that option in commitizen? I haven't tested this feature of Questionary myself though, so it might not be what I think it is either 🤔 |
Thanks @marier-nico ! Didn't notice this cool new feature. But the behavior would change a bit. If we apply this, we'll need to type |
For a normal flow it may be too disruptive, you want to move fast by pressing |
Same thought. I'll work on this one 💪 |
It seems we'd better wait for the latest questionary version. tmbo/questionary#109 Otherwise, we'll need to bound the python version to ">=3.6.1,<3.10" |
I think to implement this feature we'll need to make cz configurable which might related this issue #395 |
One solution would be to allow passing of flags used by |
Hi @arunanshub , the feature you propose was actually discussed on #248. |
Hello there, |
Hi @ciscoski , unfortunately, 'm out of bandwidth. Feel free to send us a PR. Thanks! |
@ciscoski @FelixAbrahamsson @Lee-W I'm creating an custom plugin as a Python module as mentioned on documentation here. So, since commitizen is based on questionary we can pass the keyword argument multiline=True for each question that we have. For example: class JiraCz(BaseCommitizen):
def questions(self) -> Questions:
questions = [
{
"type": "text",
"name": "issue_title",
"message": "Issue title:",
"multiline": False
},
{
"type": "text",
"name": "issue_description",
"message": "Issue description:",
"multiline": True
},
]
return questions
... I also tested the same behavior configuring the questions through a file: [tool.commitizen]
name = "cz_customize"
[tool.commitizen.customize]
# ...
[[tool.commitizen.customize.questions]]
type = "text"
name = "issue_title"
message = "Issue title:"
multiline = false
[[tool.commitizen.customize.questions]]
type = "text"
name = "issue_description"
message = "Issue description:"
multiline = true Using this plugin: cz --name cz_customize commit --dry-run This is the result:
|
Description
I would like to be able to write multiline commit messages, however this does not seem to be possible when configuring commitizen using .cz.toml.
Possible Solution
Based off of #74 it seems to work when you customize commitizen via a class, however the
filter
parameter in .cz.toml doesn't seem to work for this use case currently (it gives meValueError: 'filter' needs to be function that accepts an argument
no matter what I input).One suggestion would be if you could enclose your commit message in double quotes, and any
enter
keypress within those double quotes would just input a newline to the commit message instead of ending the text input. Another suggestion would be if you could specify a parametermultiline
or similar which upon asking the question opens up a default editor (nano/vim) where the user writes their message, just like how git does withgit commit
.The text was updated successfully, but these errors were encountered: