Itiquette/gommitlint
SHA256
3
0
Fork
You've already forked gommitlint
0
Git commit message linter with best-practice defaults. Configurable rules, CI-ready, works as CLI or pre-commit hook.
Go 95.2%
Shell 3.5%
Just 1.2%
Gommitlint Release Bot 9d3fc8db87
chore(release): bump to v0.8.5
## 0.8.5 - 2026年01月13日
### Bug Fixes
- fix mise upgrade job
### Build
- add unsupported darwin build
### CI
- set ssh multiplex to avoid ratelimit
### Features
- improve ci cache, use base renovate
### Other
- misc version bumps
- update readme
- change links for pub keys, changelog script
- use gommitlint etc
- initial commit
[skip ci]
Signed-off-by: Gommitlint Release Bot <itiquette-release-bot@pm.me>
2026年01月13日 18:56:11 +00:00
.chglog chore: initial commit 2026年01月13日 17:48:13 +01:00
.forgejo feat: improve ci cache, use base renovate 2026年01月13日 17:48:14 +01:00
assets chore: initial commit 2026年01月13日 17:48:13 +01:00
cmd/gommitlint chore: initial commit 2026年01月13日 17:48:13 +01:00
development chore: initial commit 2026年01月13日 17:48:13 +01:00
docs chore: change links for pub keys, changelog script 2026年01月13日 17:48:14 +01:00
internal chore: misc version bumps 2026年01月13日 17:48:14 +01:00
LICENSES chore: initial commit 2026年01月13日 17:48:13 +01:00
scripts feat: improve ci cache, use base renovate 2026年01月13日 17:48:14 +01:00
templates/gitcliff chore: initial commit 2026年01月13日 17:48:13 +01:00
tools chore: misc version bumps 2026年01月13日 17:48:14 +01:00
.actionlint.yaml chore: initial commit 2026年01月13日 17:48:13 +01:00
.containerignore chore: initial commit 2026年01月13日 17:48:13 +01:00
.gitattributes chore: initial commit 2026年01月13日 17:48:13 +01:00
.gitignore chore: initial commit 2026年01月13日 17:48:13 +01:00
.gitleaks.toml chore: initial commit 2026年01月13日 17:48:13 +01:00
.golangci.yml chore: initial commit 2026年01月13日 17:48:13 +01:00
.goreleaser.yaml build: add unsupported darwin build 2026年01月13日 17:48:14 +01:00
.mise.toml feat: improve ci cache, use base renovate 2026年01月13日 17:48:14 +01:00
.rumdl.toml chore: use gommitlint etc 2026年01月13日 17:48:14 +01:00
AGENTS.md chore: initial commit 2026年01月13日 17:48:13 +01:00
CHANGELOG.md chore(release): bump to v0.8.5 2026年01月13日 18:56:11 +00:00
CODE_OF_CONDUCT.md feat: improve ci cache, use base renovate 2026年01月13日 17:48:14 +01:00
CODEOWNERS chore: initial commit 2026年01月13日 17:48:13 +01:00
Containerfile chore: initial commit 2026年01月13日 17:48:13 +01:00
CONTRIBUTING.md chore: change links for pub keys, changelog script 2026年01月13日 17:48:14 +01:00
go.mod chore: misc version bumps 2026年01月13日 17:48:14 +01:00
go.sum chore: misc version bumps 2026年01月13日 17:48:14 +01:00
justfile chore: misc version bumps 2026年01月13日 17:48:14 +01:00
LICENSE chore: initial commit 2026年01月13日 17:48:13 +01:00
README.md chore: update readme 2026年01月13日 17:48:14 +01:00
renovate.json feat: improve ci cache, use base renovate 2026年01月13日 17:48:14 +01:00
REUSE.toml chore: change links for pub keys, changelog script 2026年01月13日 17:48:14 +01:00
SECURITY.md chore: change links for pub keys, changelog script 2026年01月13日 17:48:14 +01:00

Gommitlint

Codeberg Release

License: EUPL-1.2 REUSE

gommitlint logo

Gommitlint validates Git commit messages against configurable rules.


Poor commit messages make debugging, code review, and changelog generation harder. Gommitlint catches issues before they enter your history.

  • Sensible Defaults: Works out of the box with best practices enabled
  • Conventional Commits: Supports the Conventional Commits standard
  • CI/CD Ready: Multiple output formats for GitHub Actions, GitLab CI, and automation
  • Git Hooks: Validate commits before they're created
  • Single binary, zero dependencies: No Node.js, Python, or runtime required

Quick Start

What It Does

After installation, validate your commits:

gommitlint validate
COMMIT [abc1234] feat: add user authentication
 ✓ BranchAhead
 ✓ ConventionalCommit
 ✓ CryptoSignature
 ✓ LinearHistory
 ✓ SignOff
 ✓ Spell
 ✓ Subject
✓ All checks passed

When a commit fails validation:

COMMIT [def5678] add user feature
 ✓ BranchAhead
 ✗ ConventionalCommit - Must follow format: type(scope): description
 ✓ CryptoSignature
 ✓ LinearHistory
 ✓ SignOff
 ✓ Spell
 ✓ Subject
✗ 1 issue(s) found

Installation

Linux packages:

# Debian/Ubuntu
sudo dpkg -i gommitlint_*_amd64.deb
# Red Hat/Fedora/SUSE
sudo rpm -i gommitlint-*-1.x86_64.rpm
# Alpine
sudo apk add --allow-untrusted gommitlint_*_x86_64.apk

Binary (Linux/BSD/macOS1 ):

# Download and extract
tar -xzf gommitlint-<version>-<os>-<arch>.tar.gz
# Move to PATH
sudo mv gommitlint /usr/local/bin/

Mise (requires mise 2026.1+):

mise use -g gommitlint@latest

Container:

podman pull codeberg.org/itiquette/gommitlint:<version>
podman run --rm -v $(pwd):/repo codeberg.org/itiquette/gommitlint:<version> validate

Download packages and binaries from the releases page. See verification for signature verification.

Basic Usage

# Validate last commit
gommitlint validate
# Validate all commits in feature branch against main
gommitlint validate --base-branch=main
# Validate specific commit range
gommitlint validate --range=main..feature-branch
# Create a basic template
gommitlint config init

Common Use Cases

Git Hook Integration

Validate commits locally with two hooks:

# Install hooks (commit-msg + pre-push)
gommitlint hook install
# Or install globally for all repositories
gommitlint hook install --global
  • commit-msg: Validates message format before commit (blocks invalid commits)
  • pre-push: Validates signatures before push (blocks unsigned commits)

CI/CD Pipeline

# Forgejo Actions (Codeberg)- name:Validate commitsrun:| go install codeberg.org/itiquette/gommitlint@<version>
 gommitlint validate --base-branch=origin/${{ github.base_ref }} --format=forgejo

Validation Rules

Rule Config Description Enabled
BranchAhead branchahead Max commits ahead of main branch (default: 5)
CommitBody commitbody Commit body requirements (presence, length, line width)
ConventionalCommit conventional Conventional Commits format
CryptoSignature cryptosignature GPG/SSH signature verification
Identity identity Verifies committer identity
JiraReference jirareference Requires JIRA ticket references
LinearHistory linearhistory Requires linear history (no merge commits)
SignOff signoff Requires Signed-off-by trailer
Spell spell Spell checking
Subject subject Subject line length (default: max 100) and format

Rules without ✓ require explicit enabling via rules.enabled.

Configuration

Gommitlint works out of the box with sensible defaults. Customize as needed - see Reference for the complete configuration schema.

Configuration Locations

Configuration files are searched in the following order:

  1. Command-line flag: --gommitconfig=/path/to/config.yaml
  2. Project directory: .gommitlint.yaml, .gommitlint.yml, or .gommitlint.toml
  3. XDG config directory: $XDG_CONFIG_HOME/gommitlint/settings.yaml

Project-Specific Configuration

Create a .gommitlint.yaml in your project root:

gommitlint config init > .gommitlint.yaml

Example configuration:

gommitlint:message:subject:max_length:80# Ignore specific commits by SHA hash (supports abbreviated SHAs)ignore_commits:- a1b2c3d4e5f6 # Legacy commit before gommitlint adoption- f6e5d4c3b2a1 # Emergency hotfix with non-standard formatrules:enabled:- commitbody # Require detailed commit messagesdisabled:- cryptosignature # Don't require GPG/SSH signatures

Global Settings

Set default preferences that apply to all projects:

# Create XDG config directory
mkdir -p "${XDG_CONFIG_HOME}"/gommitlint
# Create user settings
gommitlint config init > "${XDG_CONFIG_HOME}"/gommitlint/settings.yaml
# Modify as needed

Output Formats

Progressive Verbosity

# Default
gommitlint validate
# Technical details
gommitlint validate -v
# Guidance
gommitlint validate -vv

Formats

# Human-readable (default, with colors when TTY detected)
gommitlint validate --format=text
# Plain text for scripting (no colors, one result per line)
gommitlint validate --format=plain
# Machine-readable JSON
gommitlint validate --format=json
# Table format (structured output)
gommitlint validate --format=table
# CI/CD formats
gommitlint validate --format=forgejo # Forgejo
gommitlint validate --format=github # GitHub Actions 
gommitlint validate --format=gitlab # GitLab CI
# Filter failed validations
gommitlint validate --format=plain | grep FAIL

Uninstallation

Important: Remove git hooks first (if installed):

gommitlint hook remove # Remove local hooks
gommitlint hook remove --global # Remove global hooks

Then uninstall based on installation method:

# Package manager installations
# Debian/Ubuntu
sudo dpkg -r gommitlint
# Red Hat/Fedora/SUSE
sudo rpm -e gommitlint
# Alpine
sudo apk del gommitlint
# Binary installation - remove the binary
rm /usr/local/bin/gommitlint # or wherever you installed it
# Go installation - remove from GOPATH
rm $(go env GOPATH)/bin/gommitlint

Supported Platforms

Platform amd64/x86_64 arm64/aarch64 riscv64 Packages
Linux .deb, .rpm, .apk, container
FreeBSD -
NetBSD -
OpenBSD -
macOS1 - - -

Note: Debian uses amd64/arm64, RPM/Alpine/archives use x86_64/aarch64.

CI/CD Actions

  • gommitlint-action • Forgejo Action
  • gommitlint-action • GitHub Action (coming soon)

Documentation

See the Contributing guide for details on how to contribute to the project!

License


  1. macOS binaries are cross-compiled but untested and unsupported. Please don't report issues for unsupported platforms. If you'd like official macOS support with testing, send me an M5 for an unlimited loan :) ↩︎