Lint your git!
$ ./gitlint --help
usage: gitlint [<flags>]
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
--subject-regex=SUBJECT-REGEX Filters commit subjects based on a regular expression.
--subject-len=SUBJECT-LEN Filters commit subjects based on length.
--body-regex=BODY-REGEX Filters commit message bodies based on a regular expression.
--path="." Path to the git repo ("." by default).
--since="1970-01-01" A date in "yyyy-MM-dd" format starting from which commits will be analyzed (default: "1970-01-01")
Additionally, it will look for configurations in a file .gitlint in the current directory if it exists. This file's format is just the same command line flags but each on a separate line. Flags passed through the command line take precedence.
Use the download-gitlint.sh script:
curl -sfL https://raw.githubusercontent.com/llorllale/go-gitlint/master/download-gitlint.sh | sh -s 1.0.0
Specifying the version is optional; if you just want the latest, omit the -s <version> part.
In both cases the correct version for your platform will be downloaded and installed at $GOPATH/bin.
- Validate format of commit message subject and body
- Lint commit msgs on varios development platforms (Windows, Linux, Mac)
- Configuration from file with cli args taking precedence
-
commit-msghook to validate my commit's msg - Performance (because a slow pre-commit hook would render the git workflow unmanageable)
- My first Go project :)
Fork this repo, make sure make checks works, and then open a PR.
To run make checks you will need:
- Go
1.11.x - Ruby 2.x (for
pdd) - pdd (a ruby gem -
gem install pdd) - golangci-lint v1.14.0 (expected to be in the
./binfolder) - weasel (
go get github.com/comcast/weasel)