Skip to content

devasherr/gitlang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gitlang

language-agnostic Git hook manager

funfact: I actually had the project name first and then started thinking “what could I build that fits gitlang?”

Gitlang helps enforce clean Git workflows using a single configuration file.

  • Enforce branch naming rules
  • Validate commit messages
  • Prevent unwanted files from being committed
  • Keep repositories consistent across teams

Installation

Download Binary (once)

sudo curl -L https://github.com/devasherr/gitlang/releases/download/v0.1.1/gitlang-cli-linux-amd64 -o /usr/local/bin/gitlang && sudo chmod +x /usr/local/bin/gitlang

Verify Installation

Run:

gitlang version

You should see:

▄▖▘▗ ▜           ▄▖  ▗   ▗
▌ ▌▜▘▐ ▀▌▛▌▛▌  ▌▌▛▌  ▜   ▜
▙▌▌▐▖▐▖█▌▌▌▙▌  ▚▘█▌▗ ▟▖▗ ▟▖
           ▄▌              

Quick Start

1. Initialize Gitlang

gitlang init

Creates a default .gitlang.yaml configuration file.

And thats it!! Gitlang automatically validates your git actvities.


Features

Examples

Pre-Commit Checks

Prevent bad commits before they happen.

pre-commit:
  enabled: true
  max_file_size_kb: 5000
  forbidden_extensions: [.log, .tmp, .swp, .exe]

Supported Checks

  • Maximum file size
  • Forbidden file extensions
  • File and folder naming conventions
  • Run commands on staged files

Commit Message Validation

Enforce clean and readable commit messages.

commit-msg:
  enabled: true
  min_length: 10
  no_trailing_period: true
  forbidden_words: [tmp, stuff, wip]

Example

✅ Valid:

fix: resolve login timeout issue

❌ Invalid:

wip.

Example Configuration

branch:
  enabled: true
  protected: [main, test]
  pattern: "^(feature|bugfix|hotfix)/[A-Z]+-[0-9]+"

pre-commit:
  enabled: true
  max_file_size_kb: 5000
  forbidden_extensions: [.log, .tmp, .swp, .exe]

  naming_conventions:
    folder:
      naming: [no_spaces, lowercase]

    file:
      naming: [no_spaces, lowercase]

commit-msg:
  enabled: true
  min_length: 10
  no_trailing_period: true
  forbidden_words: [tmp, stuff, wip]

A complete, well-commented example configuration is available at:

examples/.example.gitlang.yaml

About

Declarative Git hook manager. Define and enforce Git rules with simple YAML config

Resources

Stars

4 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages