Commitlint: Full support for other conventional-changelog-* presets

Created on 23 Feb 2018  Β·  5Comments  Β·  Source: conventional-changelog/commitlint

Perhaps it's not a matter of commitlint. But since it's a problem with commitlint, I set up an issue here.

Expected Behavior


I want to commit using commitizen and pass commitlint through hook (Hook by husky 'commitmsg').

Current Behavior


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

Affected packages

  • [x] cli
  • [ ] core
  • [ ] prompt
  • [ ] config-angular

Steps to Reproduce (for bugs)


  1. Run commitizen by yarn cz
  2. Enter the commitizen prompt.
  3. Auto run husky hook
  4. Occur error


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"
  }
}

Context


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?

Your Environment

| 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 |

feature

Most helpful comment

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.

All 5 comments

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

  1. Add rules/mappings for fields known by the official conventional-changelog presets:

    • atom: emoji, shortDesc
    • codemirror: language, type, message
    • ember: tag, taggedAs, message
    • eslint: tag, message
    • express: component, shortDesc
    • jquery: component, shortDesc
    • jshint: type, shortDesc
  2. Detect 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.

Was this page helpful?
0 / 5 - 0 ratings