1 Star 4 Fork 2

SyncGithub/vjdesign

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
verify-commit-msg.js 995 Bytes
一键复制 编辑 原始数据 按行查看 历史
fyl080801 提交于 2020-07-02 23:44 +08:00 . chore: eslint
const chalk = require("chalk");
const msgPath = process.env.GIT_PARAMS;
const msg = require("fs")
.readFileSync(msgPath, "utf-8")
.trim();
const commitRE = /^(revert: )?(feat|fix|polish|docs|style|refactor|perf|test|workflow|ci|chore|types|build)(\(.+\))?: .{1,50}/;
if (!commitRE.test(msg)) {
console.log();
console.error(
` ${chalk.bgRed.white(" ERROR ")} ${chalk.red(
`invalid commit message format.`
)}\n\n` +
chalk.red(
` Proper commit message format is required for automated changelog generation. Examples:\n\n`
) +
` ${chalk.green(`feat(compiler): add 'comments' option`)}\n` +
` ${chalk.green(
`fix(v-model): handle events on blur (close #28)`
)}\n\n` +
chalk.red(` See .github/COMMIT_CONVENTION.md for more details.\n`) +
chalk.red(
` You can also use ${chalk.cyan(
`npm run commit`
)} to interactively generate a commit message.\n`
)
);
process.exit(1);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/sync-github/vjdesign.git
git@gitee.com:sync-github/vjdesign.git
sync-github
vjdesign
vjdesign
master

搜索帮助