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.
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
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