forked from carlosrodlop/terraform-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
62 lines (61 loc) · 2.5 KB
/
.pre-commit-config.yaml
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
# https://pre-commit.com/#new-hooks
# https://engineeringfordatascience.com/posts/pre_commit_yaml/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
args: ["--markdown-linebreak-ext=md"]
- id: mixed-line-ending
- id: end-of-file-fixer
- id: check-yaml
- id: check-merge-conflict
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: detect-aws-credentials
- id: detect-private-key
- repo: https://github.com/zricethezav/gitleaks
rev: v8.15.1
hooks:
- id: gitleaks
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.77.0
hooks:
- id: terraform_fmt
files: ^clouds/
# - id: terraform_validate
# - id: terraform_checkov #https://www.checkov.io/
# files: ^clouds/
# args:
# - --args=--quiet
# - --args=--skip-check CKV2_AWS_8
- id: terraform_docs
files: ^(clouds/aws/modules/|clouds/aws/root)
args:
- --hook-config=--path-to-file=README.md # Valid UNIX path. I.e. ../TFDOC.md or docs/README.md etc.
- --hook-config=--add-to-existing-file=true # Boolean. true or false
- --hook-config=--create-file-if-not-exist=true # Boolean. true or false
- id: terraform_tflint
files: ^clouds/
args:
- "--args=--only=terraform_deprecated_interpolation"
- "--args=--only=terraform_deprecated_index"
- "--args=--only=terraform_unused_declarations"
- "--args=--only=terraform_comment_syntax"
- "--args=--only=terraform_documented_outputs"
- "--args=--only=terraform_documented_variables"
- "--args=--only=terraform_typed_variables"
- "--args=--only=terraform_module_pinned_source"
- "--args=--only=terraform_naming_convention"
- "--args=--only=terraform_required_version"
- "--args=--only=terraform_required_providers"
- "--args=--only=terraform_standard_module_structure"
- "--args=--only=terraform_workspace_remote"
# - id: terraform_tfsec #https://github.com/aquasecurity/tfsec
# files: ^terraform/
# exclude: /.terraform # Not working. I would like to exclude files downloaded inside .terraform/
# args:
# - --args=--config-file=__GIT_WORKING_DIR__/tfsec.yaml
# - --args=--concise-output