conventional-changelog/commitlint

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

Open

#896 aperta il 13 gen 2020

Vedi su GitHub
 (15 commenti) (17 reazioni) (0 assegnatari)TypeScript (896 fork)batch import
bughelp wanted

Metriche repository

Star
 (15.497 star)
Metriche merge PR
 (Merge medio 12h 56m) (52 PR mergiate in 30 g)

Descrizione

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

Guida contributor