Update lefthook rules
What does this MR do and why?
This MR updates Lefthook rules to make it smarter. It will only be run if files related to the hook change to make unrelated changes (for example, documentation) quite a bit faster.
Screenshots or screen recordings
$ git push
Lefthook v1.4.0
RUNNING HOOK: pre-push
rspec: (skip) no files for inspection
helm_lint_many_values: (skip) no files for inspection
integration_spec: (skip) no files for inspection
helm_lint: (skip) no files for inspection
SUMMARY: (SKIP EMPTY)
How to set up and validate locally
- Check out this branch
git checkout update-lefthook-rule
- Enable Lefthook if it's not already
lefthook install
- Create a commit with change to a one of the
md
filesecho "change" >> README.md && git commit -a -m "test commit"
- Execute
lefthook run pre-push
- Ensure that it doesn't execute any hooks
- Create a commit with change to a one of the
yaml
,tpl
, orrb
filesecho > templates/svc-gateway.yaml && git commit -a -m "test commit 2"
- Execute
lefthook run pre-push
- Ensure that this time it did execute hooks. In addition to that you should see spec failure
- Now you can reset the changes we've made
git reset --hard origin/update-lefthook-rule
Edited by Dmitry Gruzd