Giter Club home page Giter Club logo

commitizen-go's Introduction

Commitizen-go

Command line utility to standardize git commit messages, golang version.

demo

Contents

  • Getting Started
  • Usage
  • Configure

Getting Started

installation with Homebrew:

$ brew tap lintingzhen/tap
$ brew install commitizen-go
$ sudo commitizen-go install

installation with AUR package (Arch Linux):

$ yay commitizen-go

installation with source code:

$ make && make install

or

$ make && ./commitizen-go install

commit with commitizen

$ git cz

Usage

Usage:
  commitizen-go [flags]
  commitizen-go [command]

Available Commands:
  help        Help about any command
  install     Install this tool to git-core as git-cz
  version     Print version information and quit

Flags:
  -a, --all     tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected
  -d, --debug   debug mode, output debug info to debug.log
  -h, --help    help for commitizen-go

Use "commitizen-go [command] --help" for more information about a command.

Configure

You can customize your commit type, items, and how to assemble these items through the configuration file. Configuration file path is ~/.git-czrc, and the format is the same as the defaultConfig string in the file commit/defaultConfig.go. Type item like that:

...
{
	"name": "type",
	"desc": "Select the type of change that you're committing:",
	"form": "select",
	"options": [
		{ "name": "feat", "desc": "feat: A new feature" },
		{ "name": "fix", "desc": "fix: A bug fix" },
		{ "name": "docs", "desc": "docs: Documentation only changes" },
		{
		  "name": "style",
		  "desc":
			"style: Changes that do not affect the meaning of the code\n            (white-space, formatting, missing semi-colons, etc)"
		},
		{
		  "name": "refactor",
		  "desc": "refactor: A code change that neither fixes a bug nor adds a feature"
		},
		{
		  "name": "perf",
		  "desc": "perf: A code change that improves performance"
		},
		{ "name": "test", "desc": "test: Adding missing tests" },
		{
		  "name": "chore",
		  "desc":
			"chore: Changes to the build process or auxiliary tools\n            and libraries such as documentation generation"
		},
		{ "name": "revert", "desc": "revert: Revert to a commit" },
		{ "name": "WIP", "desc": "WIP: Work in progress" }
	],
	"required": true
},
...

Template like that:

...
"template": "{{.type}}{{with .scope}}({{.}}){{end}}: {{.subject}}{{with .body}}\n\n{{.}}{{end}}{{with .footer}}\n\n{{.}}{{end}}"
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.