@femm/verify-commit
一个简单的 commit message 校验工具
安装与使用
simple-git-hooks
运行
使用 pnpm add -D @femm/verify-commit simple-git-hooks
# OR
npm i -D @femm/verify-commit simple-git-hooks
package.json
添加配置项到 # 使用 npx + bin 运行
npm pkg set simple-git-hooks.commit-msg='npx femm-verify-commit $1'
# OR 使用 pnpm + bin 运行
npm pkg set simple-git-hooks.commit-msg='pnpm femm-verify-commit $1'
# OR 使用 node 运行
npm pkg set simple-git-hooks.commit-msg='node ./node_modules/@femm/verify-commit/index.js $1'
git-hooks
注册 当
simple-git-hooks
有更新时,需要重新注册
npx simple-git-hooks
添加
prepare
脚本,可以在install
时自动注册已经配置的git-hooks
,第一次使用时需要手动运行一次npm run prepare
npm pkg set scripts.prepare="npx simple-git-hooks"
husky
运行
使用 pnpm dlx husky-init && pnpm add -D @femm/verify-commit
# OR
npx husky-init && npm i -D @femm/verify-commit
git-hooks
注册 npx husky add .husky/commit-msg 'npx femm-verify-commit $1'