Created
December 9, 2022 03:05
-
-
Save mahalel/5eb1e53832c95643025501e804dda60d to your computer and use it in GitHub Desktop.
pre-commit bootstrap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repos: | |
- repo: https://github.com/antonbabenko/pre-commit-terraform | |
rev: v1.76.0 | |
hooks: | |
- id: terraform_fmt | |
- id: terraform_validate | |
- id: terraform_docs | |
args: | |
- --hook-config=--path-to-file=README.md | |
- --hook-config=--add-to-existing-file=true | |
- --hook-config=--create-file-if-not-exist=true | |
- id: terraform_tflint | |
- id: infracost_breakdown | |
args: | |
- --env-vars=INFRACOST_API_KEY=API_KEY | |
- --args=--path=./ | |
- --args=--terraform-var-file="terraform.tfvars" | |
verbose: true | |
- id: tfupdate | |
- id: tfupdate | |
name: Autoupdate Azurerm provider versions | |
args: | |
- --args=provider azurerm | |
- id: terraform_checkov | |
args: | |
- --args=--quiet | |
- --args=--skip-check CKV2_AZURE_1 | |
- --args=--skip-check CKV_AZURE_3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config { | |
format = "compact" | |
} | |
plugin "azurerm" { | |
enabled = true | |
version = "0.19.0" | |
source = "github.com/terraform-linters/tflint-ruleset-azurerm" | |
} | |
plugin "terraform" { | |
enabled = true | |
preset = "all" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/sh | |
echo "Configuring pre-commit hook..." | |
# make a symbolic link with the pre-commit hook | |
if [ ! -f ./git/hooks/pre-commit ]; then | |
ln git-hooks/pre-commit.sh .git/hooks/pre-commit | |
echo "Done" | |
else | |
cat <<EOF | |
A pre-commit hook exists already. | |
EOF | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
TAG=nightly | |
docker run -e "USERID=$(id -u):$(id -g)" -v $(pwd):/lint -w /lint ghcr.io/antonbabenko/pre-commit-terraform:$TAG run -a |
Hi @mahalel you might also be interested in https://github.com/star3am/terraform-modules-library
Hey, thanks @star3am - I will have a look. For what it's worth I've been mainly using a nix flake to control my dev environment and it's working pretty well, most of the time :D
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @mahalel you might also be interested in https://github.com/star3am/terraform-modules-library