What is cz-customizable and commitlint?
- cz-customizable
一款可定制化的Commitizen插件(也可作為獨立工具),旨在幫助創建如約定式提交規范的一致性提交消息。 - commitlint
commitlint 是一個用于檢查 Git 提交信息的工具,它可以幫助開發者保持提交信息的規范性和一致性。
cz-customizable快速開始
【官方文檔】
1、安裝
全局安裝 commitizen,如此一來可以快速使用 cz 或 git cz 命令進行啟動。
npm install -g commitizen
2、配置
復制以下示例配置文件內容至新建文件.cz-config.js
module.exports = {types: [{ value: 'feat', name: 'feat: A new feature' },{ value: 'fix', name: 'fix: A bug fix' },{ value: 'docs', name: 'docs: Documentation only changes' },{value: 'style',name: 'style: Changes that do not affect the meaning of the code\n (white-space, formatting, missing semi-colons, etc)',},{value: 'refactor',name: 'refactor: A code change that neither fixes a bug nor adds a feature',},{value: 'perf',name: 'perf: A code change that improves performance',