Skip to content

Commit fe1f62f

Browse files
authored
feat: Add support for running hooks on .tofu files by default (antonbabenko#875)
1 parent 9b02536 commit fe1f62f

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

.pre-commit-hooks.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
entry: hooks/infracost_breakdown.sh
55
language: script
66
require_serial: true
7-
files: \.(tf(vars)?|hcl)$
7+
files: \.(tf|tofu|tfvars|hcl)$
88
exclude: \.terraform/.*$
99

1010
- id: terraform_fmt
@@ -13,7 +13,7 @@
1313
Rewrites all Terraform configuration files to a canonical format.
1414
entry: hooks/terraform_fmt.sh
1515
language: script
16-
files: (\.tf|\.tfvars)$
16+
files: \.(tf|tofu|tfvars)$
1717
exclude: \.terraform/.*$
1818

1919
- id: terraform_docs
@@ -24,7 +24,7 @@
2424
require_serial: true
2525
entry: hooks/terraform_docs.sh
2626
language: script
27-
files: (\.tf|\.terraform\.lock\.hcl)$
27+
files: \.(tf|tofu|terraform\.lock\.hcl)$
2828
exclude: \.terraform/.*$
2929

3030
- id: terraform_docs_without_aggregate_type_defaults
@@ -35,7 +35,7 @@
3535
require_serial: true
3636
entry: hooks/terraform_docs.sh
3737
language: script
38-
files: (\.tf)$
38+
files: \.(tf|tofu)$
3939
exclude: \.terraform/.*$
4040

4141
- id: terraform_docs_replace
@@ -44,7 +44,7 @@
4444
require_serial: true
4545
entry: python -Im pre_commit_terraform replace-docs
4646
language: python
47-
files: (\.tf)$
47+
files: \.(tf|tofu)$
4848
exclude: \.terraform/.*$
4949

5050
- id: terraform_validate
@@ -53,7 +53,7 @@
5353
require_serial: true
5454
entry: hooks/terraform_validate.sh
5555
language: script
56-
files: \.(tf(vars)?|terraform\.lock\.hcl)$
56+
files: \.(tf|tofu|tfvars|terraform\.lock\.hcl)$
5757
exclude: \.terraform/.*$
5858

5959
- id: terraform_providers_lock
@@ -71,7 +71,7 @@
7171
require_serial: true
7272
entry: hooks/terraform_tflint.sh
7373
language: script
74-
files: (\.tf|\.tfvars)$
74+
files: \.(tf|tofu|tfvars)$
7575
exclude: \.terraform/.*$
7676

7777
- id: terragrunt_fmt
@@ -114,7 +114,7 @@
114114
Static analysis of Terraform templates to spot potential security issues.
115115
require_serial: true
116116
entry: hooks/terraform_tfsec.sh
117-
files: \.tf(vars)?$
117+
files: \.(tf|tofu|tfvars)$
118118
language: script
119119

120120
- id: terraform_trivy
@@ -123,7 +123,7 @@
123123
Static analysis of Terraform templates to spot potential security issues.
124124
require_serial: true
125125
entry: hooks/terraform_trivy.sh
126-
files: \.tf(vars)?$
126+
files: \.(tf|tofu|tfvars)$
127127
language: script
128128

129129
- id: checkov
@@ -133,7 +133,7 @@
133133
language: python
134134
pass_filenames: false
135135
always_run: false
136-
files: \.tf$
136+
files: \.(tf|tofu)$
137137
exclude: \.terraform/.*$
138138
require_serial: true
139139

@@ -143,7 +143,7 @@
143143
entry: hooks/terraform_checkov.sh
144144
language: script
145145
always_run: false
146-
files: \.tf$
146+
files: \.(tf|tofu)$
147147
exclude: \.terraform/.*$
148148
require_serial: true
149149

@@ -155,15 +155,15 @@
155155
pass_filenames: false
156156
always_run: false
157157
require_serial: true
158-
files: \.tf$
158+
files: \.(tf|tofu)$
159159
exclude: \.terraform/.*$
160160

161161
- id: terrascan
162162
name: terrascan
163163
description: Runs terrascan on Terraform templates.
164164
language: script
165165
entry: hooks/terrascan.sh
166-
files: \.tf$
166+
files: \.(tf|tofu)$
167167
exclude: \.terraform/.*$
168168
require_serial: true
169169

@@ -174,5 +174,5 @@
174174
entry: hooks/tfupdate.sh
175175
args:
176176
- --args=terraform
177-
files: \.tf$
177+
files: \.(tf|tofu)$
178178
require_serial: true

0 commit comments

Comments
 (0)