conventional-changelog / conventional-changelog/commitlint

Commitlint considering `Signed-off-by` as body

Open
#3,411 10 comments 2 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
TypeScript
Stars
18.7k
Forks
970
Avg merge
7h 33m
Merged PRs (30d)
49

Description

I create my commit with the following `git commit -s -m "This is a commit message"`

Which produces the following commit:

```
This is a commit message

Signed-off-by: me@example.com
```

And a configuration with the following:

```
module.exports = {
rules: {
'body-leading-blank': [2, 'always'],
'body-empty': [2, 'never'],
},
};
```

My expectation is that when I run `commitlint` I would see an error telling me that there is an empty commit body.

## Current Behavior

What I'm currently seeing is that `commitlint` appears to think that `Signed-off-by` is the commit body.

## Affected packages

- [x] cli
- [x] core
- [ ] prompt
- [ ] config-angular

## Possible Solution

N/A

## Steps to Reproduce (for bugs)

1. git commit -s -m "This is a commit message"
2. create config with the above content
3. commitlint --config -e --verbose

commitlint.config.js


```js
module.exports = {
rules: {
'body-leading-blank': [2, 'always'],
'body-empty': [2, 'never'],
},
};
```

## Context

I would like to be able to have commitlint fail on an empty message body. However, I would like to account for the fact that some folks sign their commits and others do not (not currently a requirement).

## Your Environment

| Executable | Version |
| ---------------------: | :------ |
| `commitlint --version` | `@commitlint/cli@17.1.2` |
| `git --version` | `git version 2.32.0 (Apple Git-132)` |
| `node --version` | `v14.17.5`|

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.