Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Has the default configuration of scope-case changed? #3157

Closed
lxow456 opened this issue Apr 30, 2022 · 4 comments · Fixed by #3178
Closed

Has the default configuration of scope-case changed? #3157

lxow456 opened this issue Apr 30, 2022 · 4 comments · Fixed by #3178

Comments

@lxow456
Copy link
Contributor

lxow456 commented Apr 30, 2022

 When the contents of the commitlint.config.js are as follows:

module.exports = {
    extends: ['@commitlint/config-conventional']
}

 I ran this command

git commit -m "fix(SCOPE): fix"

Expected Behavior

 According to the content here: https://commitlint.js.org/#/reference-rules, the scope-case default value is lowerCase. This commit should be aborted.

Current Behavior

 But in fact, this message passed the verification. And here are my commit logs:
image

Possible Solution

 I added the configuration of the rules, as follows:

module.exports = {
    extends: ['@commitlint/config-conventional'],
    rules: {
        'scope-case': [2, 'always', ['lower-case']]
    }
} 

 Then I commit with a same message, this time it's aborted.
image

Your Environment

Executable Version
@commitlint/config-conventional --version 16.2.4
@commitlint/cli --version 16.2.4
git --version 2.28.0.windows.1
node --version 14.7.0
@lxow456 lxow456 changed the title Has the default configuration of scope-case changed Has the default configuration of scope-case changed? Apr 30, 2022
@escapedcat
Copy link
Member

escapedcat commented May 1, 2022

Yeah, looks like it. Have a look at:

I guess the README needs to be updated. Wanna create a PR for that?
Your solution looks good.

@lxow456
Copy link
Contributor Author

lxow456 commented May 1, 2022

@escapedcat Sure, my pleasure. I referenced to the #828. The pr modified @commitlint/config-conventional/index.js. Verification of scope-case has been removed. So I've come up with a modified scheme: Maybe we can delete the description of scope-case in @commitlint/config-conventional/README.md to update it.
 If you think this is feasible, I will raise the pr. Or, do you think there is any need to optimize this scheme? I am also happy to raise after optimization.😁

@lxow456
Copy link
Contributor Author

lxow456 commented May 1, 2022

@escapedcat In addition, I found that the docs/reference-rules.md also contains the description of scope-case configuration. In my understanding, the description here is from a global perspective. But the default values of scope-case are different in @commitlint/config-conventional/index.js and @commitlint/config-angular/index.js. So for the modification here, I have no feasible idea for the time being. I don't know if this is a problem. Just wanted to tell you about it~

@escapedcat
Copy link
Member

Sorry for the late reply.

If you think this is feasible, I will raise the pr.

Let's start with this. I think it would be good clear this up.

But the default values of scope-case are different in @commitlint/config-conventional/index.js and @commitlint/config-angular/index.js.

I believe this is ok. conventional commits doens't define the scope case. Maybe angular does? I don't know tbh. But at least it's ok that they are not the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants