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-check
pre-commit run --all-files
pre-commit run terraform-validate --all-files
repos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.4.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: checkov
repos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.4.0
hooks:
- id: terragrunt-fmt
- id: terraform-validate
repos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.4.0
hooks:
- id: markdown-link-check
args:
- '--config=markdown-config.json'
repos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.4.0
hooks:
- id: shellcheck
repos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.4.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-vendor
repos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.4.0
hooks:
- id: todocheck
repos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.4.0
hooks:
- id: do-not-commit
repos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.4.0
hooks:
- id: hadolint
args:
- --config=.ci/linters/.hadolint.yaml
repos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.4.0
hooks:
- id: docker-compose-check
repos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.4.0
hooks:
- id: gitleaks
args:
- --path=.
- --repo-config-path=.ci/linters/.gitleaks.toml
- --verbose
repos:
- repo: https://github.com/hadenlabs/pre-commit-hooks
rev: 0.4.0
hooks:
- id: prepare-commit-msg
stages: [prepare-commit-msg]
Got a question?
File 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
MAJOR
version for incompatible changes. - Use the
MINOR
version when adding functionality in a backwards compatible manner. - Use the
PATCH
version when introducing backwards compatible bug fixes.
- In the context of initial development, backwards compatibility in versions
0.0.z
is not guaranteed whenz
is increased. (Initial development) - In the context of pre-release, backwards compatibility in versions
0.y.z
is not guaranteed wheny
is increased. (Pre-release)
Copyright © 2018-2022 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..