Can't work with emoji?
See original GitHub issueExpected Behavior
I use npm run commit to generate commit message, I hope it will success generate commit message!
Current Behavior
I use npm run commit to generate commit message, but the commlint check always fails !😫
Affected packages
- @commitlint/cli
- commitizen
- commitlint-config-cz
- cz-customizable
- husky
Possible Solution
I queried all documents and issess,I find maybe I need setting headerPattern
Steps to Reproduce (for bugs)
1.I npm install those:
"@commitlint/cli": "^8.2.0",
"commitizen": "^4.0.3",
"commitlint-config-cz": "^0.12.1",
"cz-customizable": "^6.2.0",
"husky": "^3.1.0"
.cz.config.js
:
module.exports = {
types: [
{ value: 'feat✨', name: '特性: 一个新的特性' },
{ value: 'fix🐞', name: '修复: 修复一个Bug' },
{ value: 'docs📚', name: '文档: 变更的只有文档' },
{ value: 'style💅', name: '格式: 空格, 分号等格式修复' },
{ value: 'refactor🛠', name: '重构: 代码重构,注意和特性、修复区分开' },
{ value: 'perf🐎', name: '性能: 提升性能' },
{ value: 'test🏁', name: '测试: 添加一个测试' },
{ value: 'revert⏪', name: '回滚: 代码回退' },
{ value: 'chore🗯', name: '工具:开发工具变动(构建、脚手架工具等)' }
],
messages: {
type: '选择一种你的提交类型:',
customScope: '请输入修改范围(可选):',
subject: '短说明:',
body: '长说明,使用"|"换行(可选):',
footer: '关联关闭的issue,例如:#31, #34(可选):',
confirmCommit: '确定提交说明?'
},
allowCustomScopes: true,
allowBreakingChanges: ['特性', '修复'],
subjectLimit: 100
}
commitlint.config.js
:
module.exports = {
extends: [
'cz'
],
rules: {
'type-empty': [2, 'never'],
'subject-empty': [2, 'never']
}
}
project.json
settings:
...
"config": {
"commitizen": {
"path": "node_modules/cz-customizable"
}
},
"cz-customizable": {
"config": ".cz-config.js"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
after I finish those step, I use npm run commit to generate commit message, but the commlint check always fails !😫 Just like this:
Context
I guess Emoji (🐞 etc.) in my commit message causes it. but I don’t know how to fix it. In fact, I have selected the type and input the subject. you can see:
? 选择一种你的提交类型: 修复: 修复一个Bug // this is my type
? 短说明: 代码提交bug // this is my subject
But the commlint check always fails ! I don’t know why, hope got your help !!
Your Environment
Executable | Version |
---|---|
commitlint --version |
“^8.2.0” |
git --version |
2.20.1 |
node --version |
v10.15.3 |
repository
this is my repository
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Emojis and special characters not working. - Apple Community
Launch System Preferences. You can do so by clicking on the 'Apple' logo in the Mac menu bar at the top, then clicking...
Read more >Emoticon Keyboard opens, but doens't work
3. Try Win+. keys to open emoji panel and see if it works. 4. If you don't see US keyboard in the input...
Read more >Why Other People Can't See Your Emojis and How to Fix It
There are several different reasons why emojis can get lost in ... but the real problems start when emojis can't be displayed at...
Read more >6 Quick Fixes for Predictive Emoji Not Working on an iPhone ...
Here's what you need to do: Open the app that doesn't show you predictive emojis. Begin typing a few characters.
Read more >How To FIX Missing Emojis On Android! (2022) - YouTube
Your browser can't play this video. Learn more. Switch camera.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Up
you can add
headerPattern
config to help commitlint parse messages with gitmojifor example
you can modify it based on my config, my configuration is also modified on the basis of @gitmoji/parser-opts