Skip to content
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

fix: exclamation mark not accepted by @commitlint/config-conventional #4191

Open
1 of 5 tasks
tiagoporto opened this issue Nov 13, 2024 · 10 comments
Open
1 of 5 tasks
Labels

Comments

@tiagoporto
Copy link

tiagoporto commented Nov 13, 2024

Steps to Reproduce

  1. Create a breaking commit using exclamation mark, like feat!: awesome feature.
  2. Try to push

// package.json
"devDependencies": {
  "@commitlint/cli": "^19.5.0",
  "@commitlint/config-conventional": "^19.5.0",
}
// .commitlintrc
{
  "extends": [
    "@commitlint/config-conventional"
  ]
}

Output error

⧗   input: feat!: awesome feature
✖   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

Current Behavior

feat!: awesome feature commit fail using @commitlint/config-conventional.

Expected Behavior

feat!: awesome feature commit should be accepted using @commitlint/config-conventional.

Affected packages

  • cli
  • core
  • prompt
  • config-angular
  • @commitlint/config-conventional

Possible Solution

No response

Context

No response

commitlint --version

19.5.0

git --version

2.39.3

node --version

20.10.0

@tiagoporto tiagoporto added the bug label Nov 13, 2024
@escapedcat
Copy link
Member

Does it work when you use the config within the package.json?:
https://github.com/conventional-changelog/commitlint/blob/master/package.json#L28-L33

Trying the commit on master seems to work:

git commit -m 'feat!: awesome feature'
yarn run v1.22.22
$ /commitlint/node_modules/.bin/lint-staged
→ No staged files match any configured task.
✨  Done in 0.35s.
yarn run v1.22.22
$ tsc -b
✨  Done in 1.50s.
[master 0xxbx6xb] feat!: awesome feature
 1 file changed, 1 insertion(+)

Wondering if this is related to #4100

@tiagoporto
Copy link
Author

Hi @escapedcat, I'm getting the same error.

I tried config in:

  • package.json
  • .commitlintrc
  • commitlint.config.js

Screenshot 2024-11-13 at 10 21 33 AM

I'm in the main branch (I don't think it could make a difference)
And I'm using [email protected].

@escapedcat
Copy link
Member

Would you mind creating a reproduction repo in github?

@tiagoporto
Copy link
Author

Sure thing, this is the repo I'm working on https://github.com/tiagoporto/svg-to-inline

@escapedcat
Copy link
Member

Uhm, seems to work if you remove this?

commitlint is still blocked by #4063
Looks like lot's of people are overriding this currently.

@tiagoporto
Copy link
Author

Yes, it works.
So, it's a side effect of the workaround: semantic-release/release-notes-generator#657
I can use a previous semantic release version to avoid this workaround.
Thank you.

@escapedcat
Copy link
Member

I see, thanks for the link. Yeah, I assume this will become more of an issue in the future

@BryanHuntNV
Copy link

Is seems that if you remove this, it will then fail to do the release with the following log:

[10:57:10 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: feat!: update yarn.lock and force release
[10:57:10 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release

The only thing I have found so far that works is reverting semantic-release to 23.1.1.

@tiagoporto
Copy link
Author

@BryanHuntNV when I install version [email protected], conventional-changelog-conventionalcommitsstills on version 7, and I get error on semantic-release/release-notes-generator.

@BryanHuntNV
Copy link

This is what I'm using that seems to be working:

    "@commitlint/cli": "19.5.0",
    "@commitlint/config-conventional": "19.5.0",
    "@semantic-release/changelog": "6.0.3",
    "@semantic-release/git": "10.0.1",
    "@semantic-release/gitlab": "13.2.1",
    "semantic-release": "23.1.1",

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