Skip to content

itiquette/gommitlint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Gommitlint

GitHub Release

OpenSSF Scorecard

License REUSE Compliance

Gommitlint validates commit messages against best practices. Keep a clean Git history.

NOTE: In heavy dev-phase, don't use seriously yet.

Features

  • 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

Quick Start

Installation

# 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

Basic Usage

# Validate last commit
gommitlint validate

# Validate commit range
gommitlint validate --range=main..HEAD

# Install Git hook for automatic validation
gommitlint install-hook

Example Output

✓ Subject         Subject is 42 characters (max: 72)
✓ Conventional    Valid conventional commit format
✗ Signoff         Missing Signed-off-by line

FAIL: 1 of 3 rules passed

Common Use Cases

Git Hook Integration

# Automatic validation before each commit
gommitlint install-hook

CI/CD Pipeline

# GitHub Actions
- name: Validate commits
  run: |
    go install github.com/itiquette/gommitlint@latest
    gommitlint validate --base-branch=origin/${{ github.base_ref }} --format=github

Team Configuration

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

Validation Rules

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

Output Formats

Progressive Verbosity

# Minimal output for CI
gommitlint validate

# Technical details for developers
gommitlint validate -v

# Educational guidance for learning
gommitlint validate -vv

Multiple Formats

# 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

Exit Codes

  • 0 • All validations passed
  • 1 • Configuration or system error
  • 2 • Validation failures found

Perfect for automation and CI/CD pipelines.

Documentation

Contributing

We welcome contributions! See our Contributing Guide for details on:

  • Reporting bugs
  • Suggesting improvements
  • Submitting pull requests
  • Testing and feedback

License


About

A commitlint tool, wip

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages