Commitlint: Rule for forcing commit body

Created on 12 Dec 2019  路  9Comments  路  Source: conventional-changelog/commitlint

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?

documentation

Most helpful comment

All 9 comments

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?

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.

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.

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

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

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

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

Looks good to me thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

texhnolyze picture texhnolyze  路  3Comments

gajus picture gajus  路  4Comments

xmlking picture xmlking  路  4Comments

ResDiaryLewis picture ResDiaryLewis  路  4Comments

marionebl picture marionebl  路  4Comments