commitizen/cz-conventional-changelog

Add validation of answers: disallow having BREAKING CHANGE but no body

vovacodes opened this issue · 4 comments

Take a commit message like this:

feat: something

BREAKING CHANGE: some breaking change

The BREAKING CHANGE section is not recognized by the tools that analyze commits, e.g. semantic-release, because BODY part of the commit is missing and they think the FOOTER is actually a BODY.
Is this a correct behavior of those tools or in other words should it be allowed to specify FOOTER without providing BODY?

If this should be forbidden, we could add the validation function to our inquirer code to validated these cases

I agree this needs to be improved but it is how the original angular commit convention was written. We could perhaps find some message to use as filler in this special case? Can you think of a good filler section to indicate that there is no commit body?

With my PR #75

You can set the "config.commitzen.defaultBody" to something like "-" which will at least guarantee there is always a body. I guess we could probably just make that happen by default if there is a breaking change.

I have added additional questions that only appear if you add a breaking change or an issue reference but have no description. It defaults the value to "-" but prompts you to change it.
#75

I think this is released in 3.0.0