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.
Add Lefthook to your system or build it from source.
go get github.com/Arkweid/lefthook
brew install Arkweid/lefthook/lefthook
You can install lefthook package from AUR
Or take it from binaries and install manually
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}
lefthook install && lefthook run pre-commit
Have a question? Check the wiki.