2 releases
new 0.0.2 | Feb 26, 2025 |
---|---|
0.0.1 | Feb 25, 2025 |
#812 in Development tools
51 downloads per month
15KB
258 lines
gitru
Git Commit Message Validation Tool
Enforces commit message conventions through configurable rules (currently supports type validation, Additional features will be implemented gradually.)
Installation
Method 1: (Recommended)
With Rust toolchain installed:
cargo install gitru
Method 2:
Download pre-built binary:
- Get latest release for your OS
- Add to system PATH
- 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
thengitru 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
~218K SLoC