★ wanayoo — archive 1999 https://github.com/commitizen-tools/commitizen/issues/264Nouvelle recherche | Portail wanayoo
Skip to content
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

Allow multiline commit messages when using a custom .cz.toml #264

Open
FelixAbrahamsson opened this issue Sep 3, 2020 · 10 comments
Open

Allow multiline commit messages when using a custom .cz.toml #264

FelixAbrahamsson opened this issue Sep 3, 2020 · 10 comments
Assignees
Labels

Comments

@FelixAbrahamsson
Copy link

@FelixAbrahamsson FelixAbrahamsson commented Sep 3, 2020

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 me ValueError: '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 parameter multiline 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 with git commit.

@Lee-W
Copy link
Member

@Lee-W Lee-W commented Sep 9, 2020

If you add | to your body (but not scope), it will be turned into a break line. This feature is not well documented at this moment.
圖片

@josix
Copy link
Contributor

@josix josix commented Sep 9, 2020

Probably we should add some notes to the prompt information? If it is possible, please feel free to assign this issue to me.
And I can also try to enhance this feature by enclosing the commit messages in single/double quotes so that it could accept the multiline messages more intuitivly.

@Lee-W Lee-W assigned Lee-W and josix and unassigned Lee-W Sep 10, 2020
@Lee-W
Copy link
Member

@Lee-W Lee-W commented Sep 10, 2020

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 This "line" should not break message?

@josix
Copy link
Contributor

@josix josix commented Sep 10, 2020

IMO, I image the behavior of using quotes should work like entering value contain multi-line words in echo parameter.
So, if the message body is This "line" should not break, the body message will display as the same words but removing the quotes, like This line should not break. And it is required to add a backslash before the quote so that we could identify the quotes should be contained in the body message. On the other hand, if there is a newline character entering between the quotes. we should allow the user keep typing in the new line. Just like following screenshot:
image

@Lee-W
Copy link
Member

@Lee-W Lee-W commented Sep 10, 2020

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 echo behavior happen easier.

@josix
Copy link
Contributor

@josix josix commented Sep 10, 2020

Yeah, I also have concern about it. I should make some survey.

@FelixAbrahamsson
Copy link
Author

@FelixAbrahamsson FelixAbrahamsson commented Sep 10, 2020

If you add | to your body (but not scope), it will be turned into a break line.

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 | character is not being translated into a newline character for me.

@Lee-W
Copy link
Member

@Lee-W Lee-W commented Sep 10, 2020

@FelixAbrahamsson Yes, it uses the filter here

@FelixAbrahamsson
Copy link
Author

@FelixAbrahamsson FelixAbrahamsson commented Sep 10, 2020

Right, that's what I was trying to do with the filter parameter in the .toml config, but it didn't seem to be possible. Does this only work via the custom class configuration?

@Lee-W
Copy link
Member

@Lee-W Lee-W commented Sep 10, 2020

I think custom class configuration should work in this case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.