priezz / lefthook

The fastest polyglot Git hooks manager out there

Home Page:https://github.com/Arkweid/lefthook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lefthook

Forked from [project-cemetery/lefthook]https://github.com/project-cemetery/lefthook.

The fastest polyglot Git hooks manager out there

Fast and powerful Git hooks manager for Node.js, Ruby or any other type of projects.

  • Fast. It is written in Go. Can run commands in parallel.
  • Powerful. With a few lines in the config you can check only the changed files on pre-push hook.
  • Simple. It is single dependency-free binary which can work in any environment.

Original tool

This repo is just Dart-wrapper for Lefthook. For detailed documentation, check the main repository.

Installation

pub global activate lefthook

You are beautiful! Just create lefthook.yml in root of your project, add description of hooks, and start using it.

Examples

Flutter

For project based on Flutter, you can run formatter before every commit and run tests and static analysis before push.

# lefthook.yml

pre-push:
  parallel: true
  commands:
    tests:
      run: flutter test
    linter:
      run: flutter analyze lib

pre-commit:
  commands:
    pretty:
      glob: "*.dart"
      run: flutter format {staged_files}

More

More examples in documentation of original repository.

About

The fastest polyglot Git hooks manager out there

https://github.com/Arkweid/lefthook

License:MIT License


Languages

Language:Dart 100.0%