gommit

command module
Version: v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2016 License: Apache-2.0 Imports: 1 Imported by: 0

README

Gommit Build Status codecov codebeat badge

Gommit analyze commits messages to ensure they follow defined pattern.

asciicast

Setup

Download from release page according to your architecture gommit binary : https://github.com/antham/gommit/releases

Define a file .gommit.toml

Create a file .gommit.toml at the root of your project, for instance :

[config]
exclude-merge-commits=true
check-summary-length=true

[matchers]
all="(?:ref|feat|test|fix|style)\\(.*?\\) : .*?\n(?:\n?(?:\\* |  ).*?\n)*"

[examples]
a_simple_commit="""
[feat|test|ref|fix|style](module) : A commit message
"""
an_extended_commit="""
[feat|test|ref|fix|style](module) : A commit message

* first line
* second line
* and so on...
"""
Config
  • exclude-merge-commits : if set to true, will not check commit mesage for merge commit
  • check-summary-length : if set to true, check commit summary length is 50 characters
Matchers

You can define as many matchers you want, naming is up to you, they will all be run against a commit message till one match.

Examples

Provided to help user to understand where is the problem, like matchers you can define as many examples as you want, they all will be displayed to the user if an error occured.

If you defined for instance :

a_simple_commit="""
[feat|test|ref|fix|style](module) : A commit message
"""

this example will be displayed to the user like that :

A simple commit :

[feat|test|ref|fix|style](module) : A commit message

key is used as a title, underscore are replaced with withespaces.

Usage

Ensure your commit messages are consistent

Usage:
  gommit [command]

Available Commands:
  check       Check commit messages
  version     App version

Flags:
      --config string    (default ".gommit.toml")
  -h, --help            help for gommit

Use "gommit [command] --help" for more information about a command.
check

You need to provide two commit references to run matching for instance :

gommit check master~2^ master

or

gommit check dev test

Documentation

The Go Gopher

There is no documentation for this package.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL