Skip to content

bug: footer-leading-blank complains with the number sign in the commit body #896

Open
@e18r

Description

@e18r

Expected Behavior

The following commit message should pass the footer-leading-blank rule:

test: footer-leading-blank bug

hello
see issue #1234

Current Behavior

The above commit message, however, fails with the following:

⧗   input: test: footer-leading-blank bug
⚠   footer must have leading blank line [footer-leading-blank]

⚠   found 0 problems, 1 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

This happens when the following conditions are true:

  1. The # symbol is present in the commit body
  2. It is immediately followed by a number
  3. It is not at the beginning of a line
  4. It doesn't appear in the first line of the commit body

For instance, the following example, taken from the spec, also triggers this bug:

fix: correct minor typos in code

see the issue for details

on typos fixed.

Reviewed-by: Z
Refs #133

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Steps to Reproduce

  1. Create a repo with the below config file
  2. In this repo, create a commit such as the above examples
  3. Run commitlint --edit
  4. An error such as the above appears
commitlint.config.js
module.exports = {
  extends: ['@commitlint/config-conventional'],
  rules: {
    'type-enum': [
      1,
      'always',
      [
        'build',
        'chore',
        'ci',
        'docs',
        'feat',
        'fix',
        'perf',
        'refactor',
        'revert',
        'style',
        'test'
      ]
    ]
  }
}

Context

I was referencing a GitHub issue in the standard GitHub format, which is #1234. This was inside a very detailed commit message with multiple lines.

Your Environment

Executable Version
commitlint --version 8.3.4
git --version 2.20.1
node --version 10.17.0

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