Commitlint: Support configuring parserOpts (conventional-commits-parser)

Created on 23 Aug 2017  路  12Comments  路  Source: conventional-changelog/commitlint

Is it possible?

enhancement feature help wanted

Most helpful comment

Published with some adaption as 3.2.
Changes

  • --parser-preset instead of --parserPreset
  • top level parserPreset takes precedence over presets from extended configuration

All 12 comments

Sure. This was part of the functionality up to version 3.
I removed it because nobody ever used it.

What is the use case you have in mind?

I would like to be able to change the headerPattern and other.

Can you describe what you want do in more detail? I'm not quite clear what kind of behaviour you want to achieve.

Sure, I meant more in terms of what commit messages you want to parse.

We already use conventional-changelog on project with follows params (legacy):

headerPattern: /^(\w*)\(([^\)]*)\)\-(\d+\s.*)$/,
headerCorrespondence: [
    'type',
    'scope',
    'subject'
],

fix(scope)-number_task subject
Now we want to add linter of commits and that he fits pattern...

I'd opt for boiling this down to a parser-preset support - that would allow changing the loaded preset from conventional-changelog-angular to e.g.@imrekb/imrekbs-convention by passing it to the cli or specifying it via commitlint.config.js. Can you help out on this?

I am thinking - yes.

How soon will be release?

I'll add some docs this evening and release it then. Stay tuned.

Published with some adaption as 3.2.
Changes

  • --parser-preset instead of --parserPreset
  • top level parserPreset takes precedence over presets from extended configuration

Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

texhnolyze picture texhnolyze  路  3Comments

pixelass picture pixelass  路  3Comments

n0nick picture n0nick  路  5Comments

MathiasKandelborg picture MathiasKandelborg  路  3Comments

EECOLOR picture EECOLOR  路  3Comments