git高效杀器——cz-customizable 搭配 commitlint

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',
    

你可能感兴趣的:(npm,前端)