Skip to content

ArjunSrivastava1/commit-linter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


commit-linter

A 'git commit' messages tool for ease of coding

Go Version License Go Report Card

AboutFeaturesQuick StartUsageConfigurationContributing

Demo

About

commit-linter is a command line interface (CLI) tool written in GO that enforces standards for git commits with elegance and precision. It validates commit messages in real-time, provides actionable feedback, and seamlessly integrates with Git to maintain consistency across your project's history.

✨ Features

Category Features
🎯 Validation Conventional Commits • Type/Scope checking • Length rules • Imperative mood
🔧 Git Integration Auto-hook install • Historical validation • Pre-commit blocking • Team consistency
🎨 Beautiful Output Color-coded feedback • Actionable suggestions • Validation scoring • Clean tables

🚀 Quick Start

📦 Installation

# One-liner install
go install github.com/ArjunSrivastava1/commit-linter

🎯 Basic Usage

# Validate a message
commit-lint "feat(auth): add login"

# Install Git hook (auto-validates all commits)
commit-lint --install

# Check last 3 commits
commit-lint --last --count 3

🛠️ Usage

Git Hook Automation

# Install once, validate forever
commit-lint --install

# Now try committing:
git commit -m "bad message"   # ❌ Blocked
git commit -m "feat: add feature"  # ✅ Allowed

CI/CD Integration

# GitHub Actions
- name: Validate Commits
  run: commit-lint --last-commit

Validate Git History

# Check last commit
commit-lint --last-commit

# Check range of commits
commit-lint --range HEAD~5..HEAD

# Check all commits in branch
commit-lint --branch main

⚙️ Team Configuration

# .commitlint.yml
rules:
  type-enum: [feat, fix, docs, style, refactor, test, chore]
  subject-min-length: 10
  subject-max-length: 72

🤝 Contributing

  1. Fork & clone
  2. Create feature branch
  3. Commit with Conventional Commits
  4. Push & open PR

See CONTRIBUTING.md for details.

📄 License

GPL v2.0 - See LICENSE


Built with ❤️ by Arjun Srivastava

Report BugRequest Featureenvaport-scanner

About

A 'git commit' messages tool for ease of coding written in GO

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages