Gitlint is a git commit message linter written in python: it checks your commit messages for style.
Features
- Commit message hook
- Easily integrated
- Sane defaults
- Easily configurable
- Community contributed rules
- User-defined rules
- Full unicode support
- Production-ready
Installation
pip
#### Pip is recommended to install the latest version
pip install gitlint
macOS
brew install gitlint
sudo port install gitlint # alternative
Ubuntu
apt-get install gitlint
Docker
docker run --ulimit nofile=1024 -v $(pwd):/repo jorisroovers/gitlint
Usage
# Check the last commit message
gitlint
# Alternatively, pipe a commit message to gitlint:
cat examples/commit-message-1 | gitlint
# or
git log -1 --pretty=%B | gitlint
# Or read the commit-msg from a file, like so:
gitlint --msg-filename examples/commit-message-2
# Lint all commits in your repo
gitlint --commits HEAD
# To install a gitlint as a commit-msg git hook:
gitlint install-hook
Top comments (0)