This repo contains Git hooks that can be run before commits to help validate
- Style
- Linting
- Build
- Test
The pre-commit hook will run all other pre-commit-* hooks.
- Git >= 2.9
- Terraform (pre-commit-terraform)
- Go (pre-commit-go)
- ShellCheck (pre-commit-bash)
- yamllint (pre-commit-yaml)
-
Add this repo as a sub module to the repo you would like to use the Git hooks for.
cd <external-repo-path> git submodule add https://github.com/jzbruno/git-hooks.git hooks/
-
Enable pre-commit hooks by removing the .disabled from the filename.
-
Configure the sub module as the Git hooks path for the external project. Each team member needs to do this when they clone the repo.
git config core.hooksPath hooks