Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 983 Bytes

other.md

File metadata and controls

50 lines (34 loc) · 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.