conventional-changelog/commitlint

Error when linting a message with the word "fix" in it using custom parser preset

开放

#3,231 创建于 2022年6月7日

 (2 条评论) (0 个反应) (0 位负责人)TypeScript (896 个派生)batch import
bughelp wanted

仓库指标

星标
 (15,497 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

When using a custom parser preset, any form of the word "fix" seems to break parsing of references.

Running echo "refs#111111 Fixed something" | commitlint yields the following error:

{
  references: [],
  subject: 'Fixed something',
  merge: null,
  header: 'refs#111111 Fixed something',
  body: null,
  footer: null,
  notes: [],
  mentions: [],
  revert: null,
  raw: 'refs#111111 Fixed something\r\n'
}
⧗   input: refs#111111 Fixed something
✖   references may not be empty [references-empty]

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

However, linting "refs#111111 This is a correct message" passes as expected.

echo "refs#111111 This is a correct message" | commitlint

{
  references: [
    {
      action: null,
      owner: null,
      repository: null,
      issue: '111111',
      raw: 'refs#111111',
      prefix: 'refs#'
    }
  ],
  subject: 'This is a correct message',
  merge: null,
  header: 'refs#111111 This is a correct message',
  body: null,
  footer: null,
  notes: [],
  mentions: [],
  revert: null,
  raw: 'refs#111111 This is a correct message\r\n'
}

Expected Behavior

The mentioned commit message should pass validation

Current Behavior

It seems as if any form of the word "fix" (e.g. "fixed", "fixes", "Fix..") must be the last word of the message or the linter will mistakenly fail.

Affected packages

  • cli
  • core (I suppose)
  • prompt
  • config-angular

Steps to Reproduce (for bugs)

Context

I am trying to configure commitlint for our custom message format refs#TICKETNO Sentence case message, where ticketno is a number at least 6 digits wide.

Your Environment

Executable Version
commitlint --version @commitlint/cli@17.0.2
git --version git version 2.35.3.windows.1
node --version v14.16.0

贡献者指南