-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
100 lines (91 loc) · 2.94 KB
/
.pre-commit-config.yaml
File metadata and controls
100 lines (91 loc) · 2.94 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
97
98
99
100
# Exclude SVG files from all hooks
exclude: '\.svg$'
repos:
# Terraform formatting - will auto-format files
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.104.0
hooks:
- id: terraform_fmt
name: Terraform Format
description: Rewrites Terraform files to canonical format
stages: [pre-commit]
- id: terraform_validate
name: Terraform Validate
description: Validates Terraform configuration files
stages: [pre-commit]
- id: terraform_tflint
name: TFLint
description: Lints Terraform code for best practices
args:
- --args=--config=__GIT_WORKING_DIR__/.tflint.hcl
stages: [pre-commit]
- id: terraform_trivy
name: Terraform Trivy
description: Security scanning
args:
- --args=--severity=HIGH,CRITICAL
- --args=--ignorefile=__GIT_WORKING_DIR__/.trivyignore
stages: [pre-commit]
- id: terraform_docs
name: Terraform Docs
description: Auto-generates documentation for Terraform modules
args:
- --hook-config=--path-to-file=README.md
- --hook-config=--add-to-existing-file=true
- --hook-config=--create-file-if-not-exist=true
files: ^(infra-ecs|infra-eks)/modules/
stages: [pre-commit]
# Secret detection
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
name: Detect Secrets
description: Prevents accidental secret commits
args: ['--baseline', '.secrets.baseline']
exclude: package-lock.json
stages: [pre-commit]
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
name: Trim Trailing Whitespace
stages: [pre-commit]
- id: end-of-file-fixer
name: Fix End of Files
stages: [pre-commit]
- id: check-yaml
name: Check YAML Syntax
stages: [pre-commit]
- id: check-added-large-files
name: Check for Large Files
args: ['--maxkb=1000']
stages: [pre-commit]
- id: check-merge-conflict
name: Check for Merge Conflicts
stages: [pre-commit]
# Terraform ECS module tests
- repo: local
hooks:
- id: terraform-ecs-tests
name: Terraform ECS Module Tests
description: Run Terraform ECS module unit tests
entry: ./pre-push.sh infra-ecs
language: system
pass_filenames: false
always_run: true
verbose: true
stages: [pre-push]
# Terraform EKS module tests
- repo: local
hooks:
- id: terraform-eks-tests
name: Terraform EKS Module Tests
description: Run Terraform EKS module unit tests
entry: ./pre-push.sh infra-eks
language: system
pass_filenames: false
always_run: true
verbose: true
stages: [pre-push]