Skip to content

Rule for forcing commit body #875

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

Closed
dsalaza4 opened this issue Dec 12, 2019 · 9 comments · Fixed by #2428
Closed

Rule for forcing commit body #875

dsalaza4 opened this issue Dec 12, 2019 · 9 comments · Fixed by #2428

Comments

@dsalaza4
Copy link

dsalaza4 commented Dec 12, 2019

Hi,

It seems like there is not a rule for forcing a message in the commit body.

I took a look here but only found the body-min-length rule.

At first I thought I could force adding something to the body by enabling the rule and setting a minimum length of, let's say 5. But it seems like the rule does not apply if the commit body is left completely empty.

Are there any thoughts on implementing a body-exists rule?

@escapedcat
Copy link
Member

No thoughts so far. I don't think someone asked for this so far. @byCedric you remember anything?
Not sure if anything would speak against such a feature. Maybe it's possible to do it with a plugin though?

@bentsi
Copy link

bentsi commented Jan 29, 2020

the same as we have scope-empty, subject-empty we need to have body-empty rule. In my use case, the body is mandatory, but currently, I am not able to enforce this.

@kleinfreund
Copy link

kleinfreund commented Feb 25, 2020

I find the current behavior very surprising. If the body-min-length criteria is set to something positive, then I expect this rule to fail if no body is present.

@flozero
Copy link

flozero commented Jan 27, 2021

Is there any update about this ? I am looking to have the same for the footer too

@armano2
Copy link
Contributor

armano2 commented Jan 27, 2021

to my knowledge there are rules for this already

https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/rules/src/footer-empty.ts
https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/rules/src/body-empty.ts

it looks like we are missing them in documentation

@flozero
Copy link

flozero commented Jan 27, 2021

You are right I test it and it works. Thanks ! The doc should be update yeah

@escapedcat
Copy link
Member

Created a PR for the docs.
@f3ltron let me know if this is enough, thanks.

@escapedcat
Copy link
Member

Didn't see @armano2 already opened a PR... it's merged, closing this. Thanks @armano2 !

@flozero
Copy link

flozero commented Jan 28, 2021

Looks good to me thanks

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

Successfully merging a pull request may close this issue.

6 participants