Skip to content

Commit e526122

Browse files
committed
Fix corrupted .pre-commit-hooks.yaml and properly add Docker hooks
- Restore clean hooks file structure - Add Docker-based hook variants at the end of file - Ensure proper YAML formatting and syntax
1 parent 3b17c2e commit e526122

File tree

1 file changed

+6
-62
lines changed

1 file changed

+6
-62
lines changed

.pre-commit-hooks.yaml

Lines changed: 6 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -4,60 +4,7 @@
44
entry: hooks/infracost_breakdown.sh
55
language: script
66
require_serial: true
7-
files: \.- id: terraform_vali- id: terraform_tf- id: terraform_docs_d- id: terraform_check- id: terraform_trivy- id: infracost_breakdown_docker
8-
name: Infracost breakdown (Docker)
9-
description: Check terraform infrastructure cost using Docker.
10-
entry: infracost
11-
language: docker_image
12-
docker_image: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest
13-
args: [breakdown, --path, .]
14-
require_serial: true
157
files: \.(tf|tofu|tfvars|hcl)$
16-
exclude: \.terraform/.*$name: Terraform validate with trivy (Docker)
17-
description: >-
18-
Static analysis of Terraform templates to spot potential security issues using Docker.
19-
require_serial: true
20-
entry: trivy
21-
language: docker_image
22-
docker_image: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest
23-
args: [config, .]
24-
files: \.(tf|tofu|tfvars)$
25-
exclude: \.terraform/.*$ name: Checkov (Docker)
26-
description: Runs checkov on Terraform templates using Docker.
27-
entry: checkov
28-
language: docker_image
29-
docker_image: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest
30-
args: [-d, .]
31-
always_run: false
32-
files: \.(tf|tofu)$
33-
exclude: \.terraform/.*$
34-
require_serial: truee: Terraform docs (Docker)
35-
description: >-
36-
Inserts input and output documentation into README.md using Docker.
37-
require_serial: true
38-
entry: terraform-docs
39-
language: docker_image
40-
docker_image: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest
41-
args: [markdown, table, --output-file, README.md, .]
42-
files: \.(tf|tofu|terraform\.lock\.hcl)$
43-
exclude: \.terraform/.*$
44-
name: Terraform validate with tflint (Docker)
45-
description: Validates all Terraform configuration files with TFLint using Docker.
46-
require_serial: true
47-
entry: tflint
48-
language: docker_image
49-
docker_image: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest
50-
files: \.(tf|tofu|tfvars)$
51-
exclude: \.terraform/.*$er
52-
name: Terraform validate (Docker)
53-
description: Validates all Terraform configuration files using Docker.
54-
require_serial: true
55-
entry: terraform
56-
language: docker_image
57-
docker_image: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest
58-
args: [validate]
59-
files: \.(tf|tofu|tfvars|terraform\.lock\.hcl)$
60-
exclude: \.terraform/.*$fvars|hcl)$
618
exclude: \.terraform/.*$
629

6310
- id: terraform_fmt
@@ -233,13 +180,10 @@
233180
require_serial: true
234181

235182
# Docker-based versions of hooks (non-breaking additions)
236-
# Note: These require a modified Docker image with ENTRYPOINT []
237-
# or use of a custom wrapper image
238183
- id: terraform_fmt_docker
239184
name: Terraform fmt (Docker)
240185
description: >-
241186
Rewrites all Terraform configuration files to a canonical format using Docker.
242-
Requires Docker image with overridden entrypoint.
243187
entry: terraform
244188
language: docker_image
245189
docker_image: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest
@@ -253,7 +197,7 @@
253197
require_serial: true
254198
entry: terraform
255199
language: docker_image
256-
docker_image: ghcr.io/antonbabenko/pre-commit-terraform:latest
200+
docker_image: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest
257201
args: [validate]
258202
files: \.(tf|tofu|tfvars|terraform\.lock\.hcl)$
259203
exclude: \.terraform/.*$
@@ -264,7 +208,7 @@
264208
require_serial: true
265209
entry: tflint
266210
language: docker_image
267-
docker_image: ghcr.io/antonbabenko/pre-commit-terraform:latest
211+
docker_image: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest
268212
files: \.(tf|tofu|tfvars)$
269213
exclude: \.terraform/.*$
270214

@@ -275,7 +219,7 @@
275219
require_serial: true
276220
entry: terraform-docs
277221
language: docker_image
278-
docker_image: ghcr.io/antonbabenko/pre-commit-terraform:latest
222+
docker_image: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest
279223
args: [markdown, table, --output-file, README.md, .]
280224
files: \.(tf|tofu|terraform\.lock\.hcl)$
281225
exclude: \.terraform/.*$
@@ -285,7 +229,7 @@
285229
description: Runs checkov on Terraform templates using Docker.
286230
entry: checkov
287231
language: docker_image
288-
docker_image: ghcr.io/antonbabenko/pre-commit-terraform:latest
232+
docker_image: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest
289233
args: [-d, .]
290234
always_run: false
291235
files: \.(tf|tofu)$
@@ -299,7 +243,7 @@
299243
require_serial: true
300244
entry: trivy
301245
language: docker_image
302-
docker_image: ghcr.io/antonbabenko/pre-commit-terraform:latest
246+
docker_image: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest
303247
args: [config, .]
304248
files: \.(tf|tofu|tfvars)$
305249
exclude: \.terraform/.*$
@@ -309,7 +253,7 @@
309253
description: Check terraform infrastructure cost using Docker.
310254
entry: infracost
311255
language: docker_image
312-
docker_image: ghcr.io/antonbabenko/pre-commit-terraform:latest
256+
docker_image: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest
313257
args: [breakdown, --path, .]
314258
require_serial: true
315259
files: \.(tf|tofu|tfvars|hcl)$

0 commit comments

Comments
 (0)