Skip to content

commitlint fails when parsing exclamation point in type/scope #884

Closed
@topocount

Description

@topocount

When I try to submit a breaking-change commit with the provided conventional commit config file used, I get an error:

husky > commit-msg (node v10.15.3)
⧗   input: test!: should work
✖   subject may not be empty [subject-empty]
✖   type may not be empty [type-empty]

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

husky > commit-msg hook failed (add --no-verify to bypass)

Expected Behavior

This commit should pass the husky check because it falls in the spec of a conventional commit

Current Behavior

The commit fails the lint, probably because the exclamation point isn't getting parsed correctly

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Steps to Reproduce (for bugs)

  1. attempt to commit changes with an exclamation point after the type/scope but before the colon

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

Your Environment

Executable Version
commitlint --version 6.4.1
git --version 2.17.1
node --version v10.15.3

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions