Closed laterdayi closed 1 year ago
Could you provide more examples or descriptions?
If you set
allowEmptyScopes: false,
allowCustomScopes: false
What other UI requirements are there or what requirements are not met ? or these two configuration items don't work ?
scope still needs to be selected
@Zhengqbbb
No scopes provide.
Yes, there was a problem with this logic, if there was no data in the scopes it would have skipped the logic with empty
/** @type {import('cz-git').UserConfig} */
module.exports = {
// 继承的规则
extends: ['@commitlint/config-conventional'],
rules: {
// type类型定义:提交的type必须在以下的类型范围内
'type-enum': [
// 错误级别
2,
// 在什么情况下验证
'always',
[
// 新功能 feature
'feat',
// 修复 bug
'fix',
// 文档更新
'docs',
// 代码格式(不影响代码运行的变动)
'style',
// 代码重构
'refactor',
// 性能优化
'perf',
// 测试相关
'test',
// 构建相关
'build',
// 持续集成
'ci',
// 代码回退
'revert',
// 其他修改
'chore'
]
],
'scope-empty': [2, 'never'],
'scope-case': [2, 'always', 'kebab-case'],
'scope-max-length': [2, 'always', '30'],
'scope-min-length': [2, 'always', '2'],
'subject-empty': [2, 'never'],
'subject-case': [0],
'subject-min-length': [2, 'always', '4']
},
prompt: {
messages: {
type: '选择提交的类型 :',
scope: '选择修改范围(可选):',
subject: '填写简短精炼的变更描述 :\n',
customFooterPrefixs: '输入自定义issue前缀 :',
footer: '列举关联issue (可选) 例如: #31, #101 :\n',
confirmCommit: '是否提交或修改commit ?'
},
types: [
{ value: 'feat', name: 'feat: ✨ 新增功能 | A new feature', emoji: ':sparkles:' },
{ value: 'fix', name: 'fix: 🐛 修复缺陷 | A bug fix', emoji: ':bug:' },
{
value: 'docs',
name: 'docs: 📝 文档更新 | Documentation only changes',
emoji: ':memo:'
},
{
value: 'style',
name: 'style: 💄 代码格式 | Changes that do not affect the meaning of the code',
emoji: ':lipstick:'
},
{
value: 'refactor',
name: 'refactor: ♻️ 代码重构 | A code change that neither fixes a bug nor adds a feature',
emoji: ':recycle:'
},
{
value: 'perf',
name: 'perf: ⚡️ 性能提升 | A code change that improves performance',
emoji: ':zap:'
},
{
value: 'test',
name: 'test: ✅ 测试相关 | Adding missing tests or correcting existing tests',
emoji: ':white_check_mark:'
},
{
value: 'build',
name: 'build: 📦️ 构建相关 | Changes that affect the build system or external dependencies',
emoji: ':package:'
},
{
value: 'ci',
name: 'ci: 🎡 持续集成 | Changes to our CI configuration files and scripts',
emoji: ':ferris_wheel:'
},
{ value: 'revert', name: 'revert: ⏪️ 代码回退 | Revert to a commit', emoji: ':hammer:' },
{
value: 'chore',
name: 'chore: 🔨 其他修改 | Other changes that do not modify src or test files',
emoji: ':rewind:'
}
],
useEmoji: true,
scopes: ['hello', 'world'],
customScopesAlign: 'top',
allowBreakingChanges: ['feat', 'fix', 'refactor', 'chore', 'ci', 'perf', 'revert'],
skipQuestions: ['body', 'footerPrefix', 'customFooterPrefixs'],
}
};
ok, Ok, looking forward to repair, in fact, there is a scene that must fill in the scope, so the scope select appears to be unnecessary
is there any time to release
thanks
cz-git ⭐v1.6.1⭐ have been release. should be resolve this ISSUE
If you don't want to, you can skipQuestion but there must be an option
@Zhengqbbb There's no way to type it directly like a subject
, right?
Yep, I prefer to search for options to avoid duplicate input
If you really don't like the search option and prefer a simple input I'll find a way to make the custom input display directly in the next version. But that's not now maybe next week. It need refactor some question logic.
@Zhengqbbb ok thank you
✅ Checklist
📄 System Info
🔎 Description
Concise Description
How can scope be mandatory instead of empty or Custom every time
Expected behavior
Steps to reproduce
Screenshots or Screen Recording(if possible)
🔗 Reproduction link / repo:
No response