subject-case has all value but failed when check
Expected Behavior
Current Behavior
Affected packages
- [ ] cli
- [ ] core
- [ ] prompt
- [ ] config-angular
Possible Solution
Steps to Reproduce (for bugs)
- commit with different message had different behaviour
- git commit -m "chore: update config to support publicPath" -> failed
- git commit -m "chore: update config to support publicpath" -> success
- git commit -m "chore: 更新配置支持 publicPath" -> success
commitlint.config.js
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'scope-case': [
2,
'always',
[
'lower-case',
'upper-case',
'camel-case',
'kebab-case',
'pascal-case',
'sentence-case',
'snake-case',
'start-case',
],
],
'subject-case': [
2,
'always',
[
'lower-case',
'upper-case',
'camel-case',
'kebab-case',
'pascal-case',
'sentence-case',
'snake-case',
'start-case',
],
],
},
}
Context
there are all configs, so i think i could type any kind of message, but as mentioned before, some kind of message failed. i want to know is it a bug or my config is wrong
Your Environment
| Executable | Version |
|---|---|
commitlint --version |
11.0.0 |
git --version |
2.30.1 |
node --version |
14.15.1 |
Hey @540692039 , can I ask what you are trying to achieve?
It looks like you want to allow all cases. If so you could just skip this rule maybe?
I guess usually people will decide for one value. Not for all possible values:
https://commitlint.js.org/#/reference-rules?id=subject-case
Maybe you can help me understand your usecase. Thanks
Hey @540692039 , can I ask what you are trying to achieve? It looks like you want to allow all cases. If so you could just skip this rule maybe?
I guess usually people will decide for one value. Not for all possible values: https://commitlint.js.org/#/reference-rules?id=subject-case
Maybe you can help me understand your usecase. Thanks
yeah, you're right, but could figure out why ⬇️ "chore: update config to support publicPath" -> failed 🥲 tell me why~ thanks "chore: update config to support publicpath" -> success
in my opinion “subject-case” may check message's first letter? how to define the range it validate
Right, this is confusing, but what are you trying to achieve? You care about one special rule or you want to set multiple?
I want to understand the background/context of this issue to support you better.
Thanks
Right, this is confusing, but what are you trying to achieve? You care about one special rule or you want to set multiple? I want to understand the background/context of this issue to support you better. Thanks
in fact, i'm trying to accept all subject-case, as you said, i can achieve this by skip this rule. but i didn't notice that, so i added all value into it for that purpose.
just curious for that behaviour, that made me confusing, for i don't know how it works: validate first letter? or whole message? or which letter spilt by space? or other condention
i'll accept all condition by skip this rule, but i'd appreciate if you can explain "subject-case" machanism, or i only cloud find source code to find out what happend😋
@540692039 You can get possible values of 'subject-case' by Official document, And learn the machanism by https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/rules/src/subject-case.ts.
Thanks @curly210102 !
@540692039 if you want to figure it out, have a look youself.
Happy for any feedback or a PR to improve this.
In general I think this is not a real usecase and wouldn't bother to "fix" this and would close this issue.
Thanks @curly210102 !
@540692039 if you want to figure it out, have a look youself. Happy for any feedback or a PR to improve this. In general I think this is not a real usecase and wouldn't bother to "fix" this and would close this issue.
ok thanks all of you