Commitlint: Subject-case rule shows wrong error message

Created on 8 Dec 2017  路  2Comments  路  Source: conventional-changelog/commitlint

Expected Behavior

I set rule 'subject-case': [2, 'always', 'sentence-case']. With title fix item I expect to see error message: subject must be sentence-case [subject-case].

Current Behavior

I set rule 'subject-case': [2, 'always', 'sentence-case']. With title fix item I see error message: subject must not be sentence-case [subject-case].


Screen shot

screen shot 2017-12-08 at 08 36 48

Steps to Reproduce (for bugs)

  1. Create config files listed below.
  2. Add commit with header: fix item.
  3. See error message with title subject must not be sentence-case [subject-case].


.commitlintrc.js

module.exports = {
  parserPreset: './.commitlint-preset',
  rules: {
    'subject-case': [2, 'always', 'sentence-case']
  }
}


.commitlint-preset.js

module.exports = {
  parserOpts: {
    headerPattern: /^(.*)$/,
    headerCorrespondence: ['subject']
  }
}

Your Environment

I'm using Tower app to work with git. It uses system git binary. Commitlint is executed using husky and commitmsg script.

| Executable | Version |
| ---: | :--- |
| commitlint --version | 5.2.3 |
| git --version | 2.13.6 (Apple Git-96) |
| node --version | 8.9.2 |

bug help wanted

Most helpful comment

Fixed with release v5.2.5

All 2 comments

Thanks for reporting this! This sounds like a bug with @commitlint/core.

Fixed with release v5.2.5

Was this page helpful?
0 / 5 - 0 ratings