Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitlint considering Signed-off-by as body #3411

Open
@tylerauerbeck

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

  • cli
  • 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /