-
Notifications
You must be signed in to change notification settings - Fork 9
commlint Always wrong? #39
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
Comments
@xieyezi Hi, it looks the error isn't caused by
You can watch, contribute the issues above, or just removing Emoji in your type should solve the issue. |
@whizark Hi ,thanks your so detail explanation, After I detele emoji, it work normally. But I wanna use it with emoji , I find all the |
Nice to hear that!
Yes, |
@xieyezi Did you found a way on how to use emojis with commitlint? |
I am enabled to use emojis by adding the following config to module.exports = {
extends: ["cz"],
rules: {
"subject-empty": [2, "never"],
"type-empty": [2, "never"],
},
parserPreset: {
parserOpts: {
headerPattern:
/^(?<type>.*\s\w*)(?:\((?<scope>.*)\))?!?:\s(?<subject>(?:(?!#).)*(?:(?!\s).))$/,
headerCorrespondence: ["type", "scope", "subject"],
},
},
}; This RegExp is borrowed from this repository: https://github.com/ccnnde/commitlint-config-git-commit-emoji |
You can try this // .cz-config.js
types: [
{
value: ':rocket: release',
name: '🚀 release: 发布版本/发布标签',
},
{
value: ':construction: WIP',
name: '💪 WIP: 正在进行的工作',
},
{
value: ':sparkles: feat',
name: '✨ feat: 新的特性',
},
{
value: ':bug: fix',
name: '🐛 fix: 修复Bug',
},
{
value: ':wrench: CI',
name: '🔧 CI: 目录结构变更(CI, Building, Tool...)',
},
{
value: ':pencil: docs',
name: '📝 docs: 仅文档更改',
},
{
value: ':twisted_rightwards_arrows: merge',
name: '🔀 merge: 合并分支',
},
{
value: ':rewind: revert',
name: '⏪ revert: 版本回滚',
},
{
value: ':white_check_mark: test',
name: '✅ test: 添加缺失的测试或更正现有测试',
},
{
value: ':chart_with_upwards_trend: perf',
name: '📈 perf: 提高性能的代码更改',
},
{
value: ':thought_balloon: chore',
name: '🗯 chore: 不修改src或测试文件的更改。例如更新构建任务、包管理器',
},
{
value: ':lipstick: ui',
name: '💄 UI: 更新UI和样式文件。',
},
{
value: ':art: style',
name: '🎨 style: 不影响代码含义的更改(空白、格式、缺少分号等)',
},
{
value: ':package: dep_up',
name: '📦 dep_up: 更新已编译的文件或包。',
},
{
value: ':hammer: refactor',
name: '🔨 refactor: 既不修复错误也不添加功能的代码更改',
},
{
value: ':truck: mv',
name: '🚚 mv: 移动或重命名文件。',
},
], Use the identifier to replace emoji But the CHANGELOG generated in this way has a big problem Because he destroyed the specification I can't solve it now |
Hi,@whizark, I appear some isses again.
What happened
I
npm install
those:this is my
.cz.config.js
:this is my
commitlint.config.js
:and this is my
project.json
settings:after I finish those step, I use
npm run commit
to generate commit message, but thecommlint check
always fails !😫 Just like this:In fact, I have selected the type and input the subject. you can see:
But the
commlint check
always fails ! I don't know why, hope got your help !!My Project
https://github.com/xieyezi/Learn-notes
The text was updated successfully, but these errors were encountered: