A collection of git hooks of possible utility. (I optimistically created a repo to hold multiple hooks despite having only written one.)
A pre-commit hook that aborts commits containing style violations.
bschmeck@osprey
[master] ~/src/example_repo > git ci -m "Example for a blog post"
Running rubocop against spec/example_repo/example_spec.rb
Rubocop found 13 offenses. Aborting commit.
spec/example_repo/example_spec.rb:9 Metrics/LineLength: Line is too long. [125/100]
- Clone this repo
- Symlink the
rubocop-pre-commit
script topre-commit
in the.git/hooks
directory of the desired repo(s) - Ensure the
pre-commit
file is executable