Skip to content
Permalink
master
Switch branches/tags
Go to file
Also add attribution badges for Cloudsmith which provide hosting for these packages.

See #197
5 contributors

Users who have contributed to this file

Loading
@Envek @zachvalenta @Vimux @MartijnCuppens @jaydorsey

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/evilmartians/lefthook

Homebrew for MacOS and Linux

brew install lefthook

Snap for Linux

snap install --classic lefthook

APT packages for Debian/Ubuntu Linux

curl -1sLf 'https://dl.cloudsmith.io/public/evilmartians/lefthook/setup.deb.sh' | sudo -E bash
sudo apt install lefthook

See all instructions: https://cloudsmith.io/~evilmartians/repos/lefthook/setup/#formats-deb

Hosted By: Cloudsmith

RPM packages for CentOS/Fedora Linux

curl -1sLf 'https://dl.cloudsmith.io/public/evilmartians/lefthook/setup.rpm.sh' | sudo -E bash
sudo yum install lefthook

See all instructions: https://cloudsmith.io/~evilmartians/repos/lefthook/setup/#repository-setup-yum

Hosted By: Cloudsmith

AUR for Arch

You can install lefthook package from AUR

Anything else

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.