Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,19 @@
name: Terraform validate (Docker)
description: >-
Validates all Terraform configuration files using Docker.
Automatically runs 'terraform init' and retries validation if provider/module
errors are detected.
NOTE: Requires Docker to be available. Use 'skip' in .pre-commit-config.yaml
if running on pre-commit.ci or other environments without Docker.
require_serial: true
entry: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest
language: docker_image
args: [terraform, validate]
args:
- /usr/bin/hooks/terraform_validate.sh
- --hook-config=--retry-once-with-cleanup=true
- --hook-config=--parallelism-ci-cpu-cores=2
- --
- .
pass_filenames: false
files: \.(tf|tofu|tfvars|terraform\.lock\.hcl)$
exclude: \.terraform/.*$
Expand Down
11 changes: 8 additions & 3 deletions examples/.pre-commit-config-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@

# Skip Docker hooks on pre-commit.ci (which doesn't support Docker)
ci:
skip: [terraform_fmt_docker, terraform_validate_docker, terraform_tflint_docker,
terraform_docs_docker, terraform_checkov_docker, terraform_trivy_docker,
infracost_breakdown_docker]
skip:
- terraform_fmt_docker
- terraform_validate_docker
- terraform_tflint_docker
- terraform_docs_docker
- terraform_checkov_docker
- terraform_trivy_docker
- infracost_breakdown_docker

repos:
- repo: https://github.com/actuarysailor/pre-commit-terraform
Expand Down
Loading