Lefthook is a Git hooks manager that allows
custom logic to be executed prior to Git committing or pushing. GDK comes with
Lefthook configuration (lefthook.yml
), but it must be installed.
We have a lefthook.yml
checked in but is ignored until Lefthook is installed.
-
Install the
lefthook
Ruby gem:bundle install
-
Install Lefthook managed Git hooks:
bundle exec lefthook install
-
Test Lefthook is working by running the Lefthook
prepare-commit-msg
Git hook:bundle exec lefthook run prepare-commit-msg
This should return a fully qualified path command with no other output.
To run the pre-push
Git hook, run:
bundle exec lefthook run pre-push
If you get the error ERROR: Vale not found
when running Lefthook, you can
install it manually.