Skip to content

Discuss the performance of Chinese message #364

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

Closed
2 of 4 tasks
weihongyu12 opened this issue Jun 6, 2018 · 6 comments
Closed
2 of 4 tasks

Discuss the performance of Chinese message #364

weihongyu12 opened this issue Jun 6, 2018 · 6 comments
Labels

Comments

@weihongyu12
Copy link

Expected Behavior

If git message appears in Chinese, it will prompt a subject-case error.

Although it is possible to disable this verification through configuration, my hope is to be able to verify both subject-case and Chinese

Current Behavior

f Chinese appears, the following error will occur

git commit -m "feat(build): 增加 git commit message 验证"
 > running commit-msg hook: commitlint -E GIT_PARAMS
⧗   input:
feat(build): 增加 git commit message 验证

✖   subject must not be sentence-case, start-case, pascal-case, upper-case [subject-case]
✖   found 1 problems, 0 warnings 

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Steps to Reproduce (for bugs)

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

Context

Your Environment

Executable Version
commitlint --version 7.0.0
git --version 2.17.1
node --version 10.3.0
@scrapooo
Copy link

scrapooo commented Jul 10, 2018

// .commitlintrc

{
  "rules": {
    "subject-case": [0]
  }
}

@marionebl marionebl added the bug label Sep 4, 2018
@LeoEatle
Copy link

I don't think it is a bug. It should be a feature request.
It is true that now the @commitlint/config-conventional is not friendly to Chinese or other non-English languages.
I think we can create a new configuration for these languages.
If I have time, I'll create a pull request for it.

@byCedric
Copy link
Member

byCedric commented Oct 3, 2018

I think this issue might be relevant too, #438. In that issue, a non-alphabetic character (1) also incorrectly fails the subject-case test. I'm not familiar at all with the Chinese characters, but I guess it also should be ignored for the subject-case test right? If so, I think my fix for issue #438 will also fix this issue. It checks if it contains an a-z or A-Z character before running the test, and it will pass the test if it doesn't have this character.

@escapedcat
Copy link
Member

@weihongyu12 please have a look if this is still an issue. It seems to work by now:

echo  "feat(build): 增加 git commit message 验证" | node ./@commitlint/cli/lib/cli.js --config ./@commitlint/config-angular/index.js

⧗   input: feat(build): 增加 git commit message 验证
✔   found 0 problems, 0 warnings
    (Need help? -> https://github.com/marionebl/commitlint#what-is-commitlint)

@weihongyu12
Copy link
Author

@escapedcat Now the commit message starting with Chinese will not prompt the error.

@escapedcat
Copy link
Member

@weihongyu12 好啊,你可以关这个issue吗?谢谢!:D

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

No branches or pull requests

6 participants