Gommitlint validates commit messages against best practices. Keep a clean Git history.
NOTE: In heavy dev-phase, don't use seriously yet.
- Zero Configuration • Works out-of-the-box with sensible defaults
- Conventional Commits • Enforces standard commit message format
- CI/CD Ready • Multiple output formats for automation
- Git Hooks • Automatic validation before commits
- Flexible Rules • Enable/disable validation as needed
- Progressive Disclosure • Different verbosity levels for different use cases
# Install with Go
go install github.com/itiquette/gommitlint@latest
# Or download binary from releases
curl -L https://github.com/itiquette/gommitlint/releases/latest/download/gommitlint-linux-amd64 -o gommitlint
chmod +x gommitlint
# Validate last commit
gommitlint validate
# Validate commit range
gommitlint validate --range=main..HEAD
# Install Git hook for automatic validation
gommitlint install-hook
✓ Subject Subject is 42 characters (max: 72)
✓ Conventional Valid conventional commit format
✗ Signoff Missing Signed-off-by line
FAIL: 1 of 3 rules passed
# Automatic validation before each commit
gommitlint install-hook
# GitHub Actions
- name: Validate commits
run: |
go install github.com/itiquette/gommitlint@latest
gommitlint validate --base-branch=origin/${{ github.base_ref }} --format=github
Create .gommitlint.yaml
in your repository:
gommitlint:
message:
subject:
max_length: 50
rules:
enabled:
- commitbody # Require detailed commit messages
disabled:
- signature # Don't require GPG signatures
Rule | Description | Default |
---|---|---|
subject |
Subject line length and format | ✓ |
conventional |
Conventional Commits format | ✓ |
signoff |
Requires Signed-off-by line | ✓ |
signature |
Validates GPG/SSH signatures | ✓ |
identity |
Verifies committer identity | ✓ |
branchahead |
Limits commits ahead of main | ✓ |
commitbody |
Requires detailed commit body | ✗ |
jirareference |
Requires JIRA ticket references | ✗ |
spell |
Spell checking | ✗ |
# Minimal output for CI
gommitlint validate
# Technical details for developers
gommitlint validate -v
# Educational guidance for learning
gommitlint validate -vv
# Human-readable (default)
gommitlint validate --format=text
# Machine-readable for automation
gommitlint validate --format=json
# CI/CD integration
gommitlint validate --format=github # GitHub Actions
gommitlint validate --format=gitlab # GitLab CI
0
• All validations passed1
• Configuration or system error2
• Validation failures found
Perfect for automation and CI/CD pipelines.
- Usage Guide • Complete configuration and examples
- Architecture • Design principles and implementation
- Configuration Examples • All available options
We welcome contributions! See our Contributing Guide for details on:
- Reporting bugs
- Suggesting improvements
- Submitting pull requests
- Testing and feedback