Perhaps it's not a matter of commitlint. But since it's a problem with commitlint, I set up an issue here.
I want to commit using commitizen and pass commitlint through hook (Hook by husky 'commitmsg').
yarn run v1.3.2
$ git-cz
[email protected], [email protected]
Line 1 will be cropped at 72 characters. All other lines will be wrapped after 72 characters.
? Select the type of change that you're committing: π: when fixing the CI build
? Write a short, present-imperative tense description of the change:
test
? Provide a longer description of the change:
A combination of "commitzen" and "conventional-changelog-atom". And check "commit" with "commitlint".
? List any breaking changes or issues closed by this change:
husky > npm run -s commitmsg (node v9.5.0)
β§ input: π test
β message may not be empty [subject-empty]
β type may not be empty [type-empty]
β found 2 problems, 0 warnings
yarn cz
package.json
{
"scripts": {
"commitmsg": "commitlint -e $GIT_PARAMS",
"cz": "git-cz"
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog-atom"
}
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
],
"parserPreset": "conventional-changelog-atom"
}
}
I don't know the cause. I'm sorry if there is a problem with the conventional-changelog-atom module. Or is there something missing in commitlint's parser-opts? Is there anything else need?
| Executable | Version |
| ---: | :--- |
| commitlint --version | 6.1.2 |
| "conventional-changelog-atom"| "^0.2.3"|
| "cz-conventional-changelog-atom"| "^0.0.2"|
| "husky"|"^0.14.3"|
| git --version | 2.15.0 |
| node --version | v9.5.0 |
Thanks for bringing this to my awareness. In fact commitlint currently does not support conventional-changelog presets that deviate from the ['type', 'scope', 'subject'] header.
I think there are two areas of work to support your use case
Add rules/mappings for fields known by the official conventional-changelog presets:
emoji, shortDesc language, type, messagetag, taggedAs, messagetag, messagecomponent, shortDesccomponent, shortDesctype, shortDescDetect parser runs that did not find a header at all and emit better error messages, e.g.:
β§ input: π test
β could not match a header with emoji, shortDesc in it.
β found 1 problems, 0 warnings
Thanks for reply. I see. So In other words, does '1.' Mean preparing config like @commitlint/config-conventional ?
About '2.' does it mean that prepare rules for conventional-changlog-atom like Rules ?
I'm busy with another thing now, so I can't afford to submit PR right now. :bow:
Is there a roadmap on the project that officially corresponds to a variant of conventional-changelog like this one?
No, 1 refers to changes that have to be implemented in commitlint itself.
Unfortunately I canβt provide a meaningful roadmap at this time.
Support for all conventional-changelog presets will happen down the line though.
Ah now I get it. It's unfortunately that there is not in the roadmap at this time.
Well then for now I'll use commitlint in Angular style. Thanks for a nice tool.
No, 1 refers to changes that have to be implemented in commitlint itself.
Would be really nice if commitlint supported plugins, eslint style. Then someone could write, for example, and "emoji" rule plugin.
Most helpful comment
Would be really nice if commitlint supported plugins, eslint style. Then someone could write, for example, and "emoji" rule plugin.