4 releases

0.0.7 Mar 7, 2025
0.0.6 Mar 2, 2025
0.0.3 Feb 28, 2025

#405 in Development tools

Download history 52/week @ 2025-02-19 507/week @ 2025-02-26 165/week @ 2025-03-05

724 downloads per month

MIT license

31KB
612 lines

gitru

Git Commit Message Validation Tool

Enforces commit message conventions through configurable rules .
(currently supports type、scope and subject validation, Additional features will be implemented gradually.)

Installation

Method 1: (Recommended)

With Rust toolchain installed:

cargo install gitru

Method 2:
Download pre-built binary:

  1. Get latest release for your OS
  2. Add to system PATH
  3. Set executable permissions:

Usage

Install hook and initialize configuration:

gitru commit-msg  ii

Command breakdown:

  • ii = install (sets up git hook) + init (creates config template)
  • Execute separately: gitru commit-msg install then gitru commit-msg init

Workflow

After installation:

  • Git hook installed to .git/hooks/commit-msg
  • Configuration template created at .commit-msg-rule.yaml

Customize validation rules by editing .commit-msg-rule.yaml

Commit validation example:

git commit -m "feat: add new API endpoint"

Validation Failure Example:

git commit -m "add feature"

Error: Invalid commit message format...
Valid format: feat: Add feature

Dependencies

~9–17MB
~217K SLoC