Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (34 sloc) 983 Bytes

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

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.

You can’t perform that action at this time.