Commitlint: Valid commit message subject is rejected

Created on 10 Sep 2018  路  4Comments  路  Source: conventional-changelog/commitlint

Expected Behavior



Subject starts with 1.0.1 should be considered valid

Current Behavior



printf "chore(release): 1.0.1 [skip ci]nn## 1.0.1 (2018-09-09)nnn### Bug Fixesnn* build: now updating version (2d913ea)nnnn" | npx commitlint

This give error
Also reported here:
https://github.com/semantic-release/semantic-release/issues/928#issuecomment-419959643

Affected packages

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

Possible Solution


Steps to Reproduce (for bugs)



https://github.com/xmlking/ngx-starter-kit/blob/master/package.json


commitlint.config.js


Context


Your Environment

| Executable | Version |
| ---: | :--- |
| commitlint --version | VERSION |
| git --version | VERSION |
| node --version | VERSION |

bug

Most helpful comment

So basically you are saying that @commitlint/config-conventional shouldn't enforce any subject casing, because it simply isn't in the spec right? Got the same issue using:

$ printf "chore(release): 1.0.1 [skip ci]\n\n## [1.0.1](https://github.com/xmlking/ngx-starter-kit/compare/v1.0.0...v1.0.1) (2018-09-09)\n\n\n### Bug Fixes\n\n* **build:** now updating version ([2d913ea](https://github.com/xmlking/ngx-s
tarter-kit/commit/2d913ea))\n\n\n\n" | npx commitlint -x '@commitlint/config-conventional'

I'm not sure if this was intentional, but it looks like the sentence-case setting of the subject-case rule is failing with numbers/semantic versioning.

Until this is resolved, you can temporarily work around this by adjusting the subject-sentence rule.

{
  "commitlint": {
    "extends": ["@commitlint/config-conventional"],
    "rules": {
      "subject-case": [2, "never", ["start-case", "pascal-case", "upper-case"]]
    }
  }
}

All 4 comments

So basically you are saying that @commitlint/config-conventional shouldn't enforce any subject casing, because it simply isn't in the spec right? Got the same issue using:

$ printf "chore(release): 1.0.1 [skip ci]\n\n## [1.0.1](https://github.com/xmlking/ngx-starter-kit/compare/v1.0.0...v1.0.1) (2018-09-09)\n\n\n### Bug Fixes\n\n* **build:** now updating version ([2d913ea](https://github.com/xmlking/ngx-s
tarter-kit/commit/2d913ea))\n\n\n\n" | npx commitlint -x '@commitlint/config-conventional'

I'm not sure if this was intentional, but it looks like the sentence-case setting of the subject-case rule is failing with numbers/semantic versioning.

Until this is resolved, you can temporarily work around this by adjusting the subject-sentence rule.

{
  "commitlint": {
    "extends": ["@commitlint/config-conventional"],
    "rules": {
      "subject-case": [2, "never", ["start-case", "pascal-case", "upper-case"]]
    }
  }
}

@byCedric is right, we should ignore characters not matching [a-zA-Z] from the case rules in general.

any update in this issue ?
thanks

@xmlking Sorry, I had a bit too much work on my hands these past weeks. Right now, I'm writing a fix for this. Please stick with us here! 馃槃

Was this page helpful?
0 / 5 - 0 ratings