https://github.com/petergrace/pre-commit-hooks
Pete's custom pre-commit hooks
https://github.com/petergrace/pre-commit-hooks
Last synced: about 1 year ago
JSON representation
Pete's custom pre-commit hooks
- Host: GitHub
- URL: https://github.com/petergrace/pre-commit-hooks
- Owner: PeterGrace
- Created: 2020-02-05T13:41:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-23T19:51:28.000Z (almost 6 years ago)
- Last Synced: 2025-02-15T02:44:36.784Z (over 1 year ago)
- Language: Shell
- Size: 19.5 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pre-commit-hooks
Repository of pre-commit hooks I've created to help guard myself against dumb mistakes in commits.
## how to use
This repository is meant to be referenced by the [pre-commit](https://pre-commit.com) helper app.
Add this to your `.pre-commit-config.yaml` file at the root of your repo, specifying the hooks you wish to use for the repository in question:
```
- repo: https://github.com/PeterGrace/pre-commit-hooks
rev: master
hooks:
- id: kustomize-build
- id: kustomize-missing
- id: <...>
```
## the hooks
- terraform-format -- runs `terraform fmt` on all terraform files in the repo, formatting them and syntax checking them.
- kustomize-build -- runs `kustomize build .` against a found kustomize manifest and ensures the files can actually create a legit manifest.
- kustomize-missing -- compares the found yaml manifests vs. the listed yamls in kustomize manifest to detect when there are discrepancies.
- if you intentionally want to not put a patched yaml in your kustomization.yaml file, add it to the file like `#ignore file.yaml`
- check-all-kustomize -- like kustomize-build, but iterates the entire git repo attempting to build all kustomize recipes. Good for ensuring your changes don't clobber a different deployment.