Skip to content

Commit

Permalink
docs: show more info when verify commit fails (#125)
Browse files Browse the repository at this point in the history
* docs: show more info when verify commit fails

* docs: show rules details when verify commit fails
  • Loading branch information
Lsnsh committed Apr 24, 2022
1 parent d141d01 commit d739b70
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/verifyCommit.ts
Expand Up @@ -17,13 +17,15 @@ if (!commitRE.test(msg)) {
` ${chalk.bgRed.white(' ERROR ')} ${chalk.red(`提交日志不符合规范`)}\n\n${chalk.red(
` 合法的提交日志格式如下(emoji 和 模块可选填):\n\n`,
)}
${chalk.green(`💥 feat(模块): 添加了个很棒的功能`)}
${chalk.green(`🐛 fix(模块): 修复了一些 bug`)}
${chalk.green(`📝 docs(模块): 更新了一下文档`)}
${chalk.green(`🌷 UI(模块): 修改了一下样式`)}
${chalk.green(`🏰 chore(模块): 对脚手架做了些更改`)}
${chalk.green(`🌐 locale(模块): 为国际化做了微小的贡献`)}
${chalk.red(`See .github/commit-convention.md for more details.\n`)}`,
${chalk.green(`[<emoji>] [revert: ?]<type>[(scope)?]: <message>\n`)}
${chalk.green(`💥 feat(模块): 添加了个很棒的功能`)}
${chalk.green(`🐛 fix(模块): 修复了一些 bug`)}
${chalk.green(`📝 docs(模块): 更新了一下文档`)}
${chalk.green(`🌷 UI(模块): 修改了一下样式`)}
${chalk.green(`🏰 chore(模块): 对脚手架做了些更改`)}
${chalk.green(`🌐 locale(模块): 为国际化做了微小的贡献\n`)}
${chalk.green(`其他提交类型: refactor, ⚡perf, workflow, build, CI, typos, tests, types, wip, release, dep\n`)}
${chalk.red(`See .github/commit-convention.md for more details.\n`)}`,
);
} else {
console.error(
Expand All @@ -32,13 +34,15 @@ if (!commitRE.test(msg)) {
)}\n\n${chalk.red(
` Proper commit message format is required for automated changelog generation. Examples:\n\n`,
)}
${chalk.green(`💥 feat(compiler): add 'comments' option`)}
${chalk.green(`🐛 fix(compiler): fix some bug`)}
${chalk.green(`📝 docs(compiler): add some docs`)}
${chalk.green(`🌷 UI(compiler): better styles`)}
${chalk.green(`🏰 chore(compiler): Made some changes to the scaffolding`)}
${chalk.green(`🌐 locale(compiler): Made a small contribution to internationalization`)}\n
${chalk.red(`See .github/commit-convention.md for more details.\n`)}`,
${chalk.green(`[<emoji>] [revert: ?]<type>[(scope)?]: <message>\n`)}
${chalk.green(`💥 feat(compiler): add 'comments' option`)}
${chalk.green(`🐛 fix(compiler): fix some bug`)}
${chalk.green(`📝 docs(compiler): add some docs`)}
${chalk.green(`🌷 UI(compiler): better styles`)}
${chalk.green(`🏰 chore(compiler): Made some changes to the scaffolding`)}
${chalk.green(`🌐 locale(compiler): Made a small contribution to internationalization\n`)}
${chalk.green(`Other commit types: refactor, ⚡perf, workflow, build, CI, typos, tests, types, wip, release, dep\n`)}
${chalk.red(`See .github/commit-convention.md for more details.\n`)}`,
);
}

Expand Down

0 comments on commit d739b70

Please sign in to comment.