Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 5 tasks
dmoonfire opened this issue Dec 18, 2019 · 3 comments
Closed
1 of 5 tasks
Labels

Comments

@dmoonfire
Copy link
Contributor

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
@escapedcat
Copy link
Member

escapedcat commented Dec 18, 2019

Hey @dmoonfire , you're right. For now this isn't supported by commitlint.
But we have an upcomming PR for this already: #767
Please be patient, this might take a bit longer :)

This duplicates #658 I think.

@byCedric
Copy link
Member

@escapedcat I think we need to release the beta version as the latest. I reworked the conventional changelog plugins, which is actually published on the next dist tag. But, I think we are ready for a new release right? 😄

@dmoonfire You can try this version using commitlint 8.3.3, replace the npm install with this:

$ npm install @commitlint/cli@next @commitlint/config-conventional@next

@dmoonfire
Copy link
Contributor Author

Thank you, that is exactly what I was looking for but couldn't figure it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants