forked from hoverkraft-tech/terraform-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
96 lines (94 loc) · 3.48 KB
/
.pre-commit-config.yaml
File metadata and controls
96 lines (94 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
exclude: ^.*/\.infracost/terraform_modules/manifest\.json$
- id: check-added-large-files
- id: check-case-conflict
- id: check-json
- id: check-executables-have-shebangs
- id: check-symlinks
- id: check-yaml
- id: detect-aws-credentials
- id: mixed-line-ending
- id: trailing-whitespace
# - id: no-commit-to-branch
# args: [--branch, main]
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.101.1
hooks:
- id: tfupdate
name: Autoupdate Terraform versions
args:
- --args=terraform --version "~> 1.3"
- id: tfupdate
name: Autoupdate Terraform versions (local provider)
args:
- --args=provider hashicorp/local
- --args=--version '>= 2.5.0, <3.0.0'
- id: tfupdate
name: Autoupdate Terraform versions (kubernetes provider)
args:
- --args=provider hashicorp/kubernetes
- --args=--version '>= 2.38.0, <3.0.0'
- id: tfupdate
name: Autoupdate Terraform versions (random provider)
args:
- --args=provider hashicorp/random
- --args=--version '>= 3.4.0, <4.0.0'
- id: tfupdate
name: Autoupdate Terraform versions (time provider)
args:
- --args=provider hashicorp/time
- --args=--version '>= 0.13.1, <1.0.0'
- id: tfupdate
name: Autoupdate Terraform versions (tls provider)
args:
- --args=provider hashicorp/tls
- --args=--version '>= 4.1.0, <5.0.0'
- id: tfupdate
name: Autoupdate aws provider versions
args:
- --args=provider aws --version ">= 4.67.0, < 5.0.0"
- id: tfupdate
name: Autoupdate helm provider versions
args:
- --args=provider helm --version ">= 2.17.0, < 3.0.0"
- id: tfupdate
name: Autoupdate pass provider versions
args:
- --args=provider mecodia/pass --version ">= 3.1.0, < 4.0.0"
# This hook is configured to run only in manual stage to avoid unnecessary provider lock file updates on every commit.
# Run this hook manually when you need to update the provider lock file across all supported platforms.
- id: terraform_providers_lock
stages: [manual]
args:
- --hook-config=--mode=only-check-is-current-lockfile-cross-platform
- --args=-platform=windows_amd64
- --args=-platform=darwin_amd64
- --args=-platform=darwin_arm64
- --args=-platform=linux_amd64
- --args=-platform=linux_arm64
- id: terraform_validate
args:
- --hook-config=--parallelism-limit=1
- --hook-config=--retry-once-with-cleanup=true
- --tf-init-args=-reconfigure
- id: terraform_fmt
- id: terraform_docs
args:
- "--args=--lockfile=false"
- --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
args:
- "--args=--module"
- "--args=--config=__GIT_WORKING_DIR__/.tflint.hcl"
- --hook-config=--delegate-chdir
- id: terraform_trivy
- id: terraform_checkov
args:
- --args=--config-file __GIT_WORKING_DIR__/.checkov.yaml