conventional-changelog/commitlint

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

Open

#896 aberto em 13 de jan. de 2020

Ver no GitHub
 (15 comments) (17 reactions) (0 assignees)TypeScript (896 forks)batch import
bughelp wanted

Métricas do repositório

Stars
 (15.497 stars)
Métricas de merge de PR
 (Mesclagem média 12h 56m) (52 fundiu PRs em 30d)

Description

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

Guia do colaborador