Skip to content

Can't figure out the settings needed to use ! in the commit message #878

Closed
@dmoonfire

Description

@dmoonfire

I noticed with the version 1.0.0 of Conventional Commits, they added a ! in the first line:

  1. BREAKING CHANGE: a commit that has a footer BREAKING CHANGE:, or appends a ! after the type/scope, introduces a breaking API change (correlating with MAJOR in semantic versioning). A BREAKING CHANGE can be part of commits of any type.

On the page, there is an example:

refactor!: drop support for Node 6

BREAKING CHANGE: refactor to use JavaScript features not available in Node 6.

Naturally, I liked that so I tried to use it.

Expected Behavior

The entries in my package.json:

"@commitlint/cli": "^8.2.0",
"@commitlint/config-conventional": "^8.2.0",

When I run the following command, I would expect it to pass.

$ cat | ./node_modules/.bin/commitlint 
refactor!: drop support for Node 6

BREAKING CHANGE: refactor to use JavaScript features not available in Node 6.
^D
$

Current Behavior

$ cat | ./node_modules/.bin/commitlint 
refactor!: drop support for Node 6

BREAKING CHANGE: refactor to use JavaScript features not available in Node 6.
^D
⧗   input: refactor!: drop support for Node 6

BREAKING CHANGE: refactor to use JavaScript features not available in Node 6.
✖   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

$

Affected packages

  • cli
  • core
  • prompt
  • config-angular
  • config-conventional

Possible Solution

I'm not sure, maybe a regular expression needs to change?

Steps to Reproduce (for bugs)

  1. Create a package
  2. npm install @commitlint/cli@latest @commitlint/config-conventional@latest
  3. echo 'refactor!: test' ./node_modules/.bin/commitlint

Context

I would like to use the new ! because it communicates something useful to my team.

Your Environment

Executable Version
commitlint --version 8.2.0
git --version 2.20.1
node --version 8.16.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions