This repository is a collection of Git hooks to be used with the pre-commit framework.
- Install pre-commit. E.g.
brew install pre-commit
- Install Terraform, TFLint, Go, markdown-link-check, shellcheck. E.g
brew install terraform \
tflint \
go \
golangci/tap/golangci-lint \
shellcheck && \
yarn global add markdown-link-checkCreate a .pre-commit-config.yaml inside your repositories and add the desired list of hooks. Please see the documentation for further information.
repos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.6.0
hooks:
- id: terraform-fmt
- id: terraform-validate
- id: markdown-link-check
- id: go-fmtOnce you created the configuration file inside your repository, you must run pre-commit install to activate the hooks. That's it, pre-commit will now listen for changes in your files and run the checks accordingly.
pre-commit run --all-filespre-commit run terraform-validate --all-filesrepos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.6.0
hooks:
- id: terraform-fmt
- id: terraform-validate
- id: terraform-docs
args:
- "--output-file=docs/include/terraform.md"
- "--output-mode=replace"
- "--sort-by-type"
- id: terraform-docs-replace
- id: terraform-tflint
- id: terraform-tfsec
- id: checkovrepos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.6.0
hooks:
- id: terragrunt-fmt
- id: terraform-validaterepos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.6.0
hooks:
- id: markdown-link-check
args:
- "--config=markdown-config.json"repos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.6.0
hooks:
- id: shellcheckrepos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.6.0
hooks:
- id: go-fmt
- id: go-imports
- id: go-vet
- id: golint
- id: gocyclo
- id: validate-toml
- id: no-go-testing
- id: golangci-lint
- id: go-critic
- id: go-unit-tests
- id: go-build
- id: go-mod-tidy
- id: go-mod-vendorrepos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.6.0
hooks:
- id: todocheckrepos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.6.0
hooks:
- id: do-not-commitrepos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.6.0
hooks:
- id: hadolintrepos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.6.0
hooks:
- id: docker-compose-checkrepos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.6.0
hooks:
- id: gitleaks
args:
- --path=.
- --repo-config-path=.github/linters/.gitleaks.toml
- --verboserepos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.6.0
hooks:
- id: prepare-commit-msg
stages: [prepare-commit-msg]repos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.6.0
hooks:
- id: block-files
args: ["--ext", ".key", "--ext", ".crt"]repos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.6.0
hooks:
- id: ktlintFile a GitHub issue.
See Contributing.
This Module follows the principles of Semantic Versioning (SemVer).
Using the given version number of MAJOR.MINOR.PATCH, we apply the following constructs:
- Use the
MAJORversion for incompatible changes. - Use the
MINORversion when adding functionality in a backwards compatible manner. - Use the
PATCHversion when introducing backwards compatible bug fixes.
- In the context of initial development, backwards compatibility in versions
0.0.zis not guaranteed whenzis increased. (Initial development) - In the context of pre-release, backwards compatibility in versions
0.y.zis not guaranteed whenyis increased. (Pre-release)
Copyright Β© 2018-2025 Hadenlabs
All other trademarks referenced herein are the property of their respective owners.
The code and styles are licensed under the LGPL-3.0 license See project license..