Skip to content

Subject-case rule shows wrong error message #192

@vladshcherbin

Description

@vladshcherbin

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions