gto22834 / cz-template

The customized Commitizen template to formulate commit message.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cz-template

The Commitizen adapter to formulate commit message. This repository is inspired by cz-emoji

Install

  1. Install package
$ npm i -g commitizen
$ npm i -g cz-template
  1. create .czrc in your project folder

Usage

The ./czrc look like...

  1. You can add questions, scopes, types to extend default setting.
  2. Change formula with es6 strings template to format commit message reference Support:
    • ${title}: This will fill commit type e.q. feat, fix, ...
    • ${emoji}: Fill emoji icon
    • ${subject}: Fill subject of commit message
    • ${description}: Fill description about commit message
    • ${scope}: Fill scope name e.q. ${title} ${emoji} ${scope}: ${subject => fix πŸŽ‰ (common): Fixed example

NOTE: Have a issue with scopes

{
  "path": "cz-template",
  "config": {
    "cz-template": {
      "questions": [
        {
          "type": "input",
          "name": "issues",
          "message": "Add issue references (e.g. 'fix #123', 're #123'.):\n"
        },
        {
          "type": "list",
          "name": "scope",
          "message": "What is the scope of this change (e.g. component or file name)?",
          "choices": [
            {
              "name": "None",
              "value": ""
            },
            {
              "name": "test-scope",
              "value": "test-scope"
            }
          ]
        }
      ],
      "types": [
        {
          "description": "Add new feature",
          "title": "Features",
          "name": "feat",
          "emoji": "πŸŽ‰",
          "code": ":tada:"
        },
        {
          "description": "Add type test",
          "title": "Test add type",
          "name": "testAddType",
          "emoji": "πŸŽ‰",
          "code": ":tada:"
        }
      ],
      "formula": "${title} ${emoji} ${scope}: ${subject}"
    }
  }
}

TODO

  • Fixed scopes options
  • Add loader to find .czrc (reference)
  • Pull request cz-ci to support js format

Reference:

cz-emoji cz-cli

About

The customized Commitizen template to formulate commit message.


Languages

Language:JavaScript 100.0%