Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.06 KB

File metadata and controls

53 lines (36 loc) · 1.06 KB

Lefthook in any environments

This is the guide to use the Lefthook git hook manager in any environment. You can find guides for Ruby and Node.js in README.md.

Installation

Add Lefthook to your system or build it from source.

go

go get github.com/Arkweid/lefthook

Homebrew for macOS

brew install Arkweid/lefthook/lefthook

AUR for Arch

You can install lefthook package from AUR

Or take it from binaries and install manually

pip for Python

You can find Python wrapper here package

Edit

Create and edit lefthook.yml:

pre-commit:
  parallel: true
  commands:
    audit:
      run: brakeman --no-pager
    rubocop:
      files: git diff --name-only @{push}
      glob: "*.rb"
      run: rubocop {files}

Test it

lefthook install && lefthook run pre-commit

More info

Have a question? Check the wiki.