fix: exclamation mark not accepted by @commitlint/config-conventional
Steps to Reproduce
- Create a breaking commit using exclamation mark, like
feat!: awesome feature. - 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
- [x] @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
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
Hi @escapedcat, I'm getting the same error.
I tried config in:
package.json.commitlintrccommitlint.config.js
I'm in the main branch (I don't think it could make a difference)
And I'm using [email protected].
Would you mind creating a reproduction repo in github?
Sure thing, this is the repo I'm working on https://github.com/tiagoporto/svg-to-inline
Uhm, seems to work if you remove this?
commitlint is still blocked by #4063
Looks like lot's of people are overriding this currently.
Yes, it works. So, it's a side effect of the workaround: https://github.com/semantic-release/release-notes-generator/issues/657 I can use a previous semantic release version to avoid this workaround. Thank you.
I see, thanks for the link. Yeah, I assume this will become more of an issue in the future
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.
@BryanHuntNV when I install version [email protected], conventional-changelog-conventionalcommitsstills on version 7, and I get error on semantic-release/release-notes-generator.
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",
I'm still seeing this today but cannot use older versions. What is the actual issue, a regression somewhere between those versions and now?
@TheRealWaldo, the issue is with conventional-changelog-conventionalcommits version < 8.
Try to check the version your project is using.
I'm still having to override it.