diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 50607541e..f99971ee5 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -13,7 +13,9 @@ Rewrites all Terraform configuration files to a canonical format. entry: hooks/terraform_fmt.sh language: script - files: \.(tf|tofu|tfvars)$ + # Supported extensions by Terraform specified in + # https://github.com/hashicorp/terraform/blob/0c63fb2b097edcd5cb1a91322765a414206fbea2/internal/command/fmt.go#L30-L35 + files: \.(tf|tofu|tfvars|tftest\.hcl|tfmock\.hcl)$ exclude: \.terraform/.*$ - id: terraform_docs