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

The cz ch command generates a CHANGELOG.md that includes the content from the body. #1267

Open
gbaian10 opened this issue Oct 19, 2024 · 2 comments

Comments

@gbaian10
Copy link
Contributor

Description

When I use the cz ch command, I only want it to capture the title part and not read or parse the body part.

Currently, I guess that this piece of code is parsing the body.

image

I'm not sure if my input and output situation matches your expected output.
However, I hope it doesn't parse the content of the body.
If this result is what you originally expected, I would like to add a flag to stop parsing the body.

Steps to reproduce

My commit message:

image

Current behavior

image

Desired behavior

image

Screenshots

No response

Environment

cz-version==3.29.1
python-version==3.12.7
operating system==window10

@Lee-W
Copy link
Member

Lee-W commented Oct 20, 2024

Whether to include the content from the body is something we probably could make it configurable. But will probably need to check whether it makes sense to other cz rules. If not, how we can make it happen.

Also, the example you provide doesn't look right 🤔 It should be

### refactor
* 12 

fix: ...
feat:

It's at least a bug we would like it to be fixed.

@gbaian10
Copy link
Contributor Author

I'm not sure which incorrect example you're talking about, the current output or the expected output?

The current logic always splits the body section with \n\n, then uses strings starting with keywords like feat, fix, refactor, perf, or BREAKING CHANGE as part of the changelog.

Here are more current output examples.


image

Body "feat" is connected to the previous line "Hello World!" and they are treated as one string, failing the regex check and being ignored.


image

The two paragraphs are separate. "Hello World" fails the regex check and won't be displayed, but "feat" will appear in the changelog.


image

There is no body section, but the title has two lines that are ultimately connected into a single string.
However, when the body section has multiple lines, the line breaks are preserved, and they are not connected into one string.


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

No branches or pull requests

2 participants