Skip to content

Latest commit

 

History

History
52 lines (36 loc) · 976 Bytes

11-hooks.md

File metadata and controls

52 lines (36 loc) · 976 Bytes

Git Hooks

WARNING: don't use server side hooks

Try not to use server-side git hooks, they usually annoy devs. But client-side hooks are totally fine, because you can easily disable it.

quickhook

dirk/quickhook

brew tap dirk/quickhook

brew install quickhook

mkdir -p .quickhook/pre-commit

cat bin/rubocop > .quickhoook/pre-commit/rubocop

quickhook install

Pros:

  • Fast

Cons:

  • Needs separate installation
  • No instructions for building on linux

overcommit

sds/overcommit

bundle add overcommit --group development

bundle exec overcommit --install

echo 'gemfile: Gemfile' >> .overcommit.yml

# Or uncomment
echo 'PreCommit:
  RuboCop:
    enabled: true
    on_warn: fail' >> .overcommit.yml

Pros:

  • Easier to install automatically
  • Has many checks by default

Cons:

  • Slow