Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
4 contributors

Users who have contributed to this file

@jaydorsey @Arkweid @Vimux @MartijnCuppens
37 lines (27 sloc) 742 Bytes

Lefthook in Ruby

This is guide of using Lefthook git hook manager in Ruby projects. You can find guides for other environments in README.md.

Install

gem install lefthook

Edit

Create and edit lefthook.yml:

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

Test it

lefthook install && lefthook run pre-commit

Troubleshooting

If you see the error lefthook: command not found you need to check your $PATH. Also try to restart your terminal.

More info

Have a question? Check the wiki.

You can’t perform that action at this time.