-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
75 lines (69 loc) · 1.98 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
63
64
65
66
67
68
69
70
71
72
73
74
75
# ref. https://pre-commit.com/#plugins
# 特定のhookでエラーが発生した時点でエラー終了
fail_fast: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-json
- id: check-toml
- id: check-yaml
# test
- repo: local
hooks:
- id: test-matrix
name: check test_matrix.yaml
entry: ./scripts/check_test_matrix.sh
language: system
always_run: true
# opa
- repo: local
hooks:
- id: opa-fmt
name: run opa fmt
entry: ./scripts/opafmt.sh
language: system
files: (\.rego)$
- id: regal-lint
name: run regal lint
entry: ./scripts/regal.sh
language: system
files: (\.rego)$
- id: conftest
name: run conftest
entry: ./scripts/conftest.sh
language: system
always_run: true
# terraform
- repo: local
hooks:
- id: terraform-fmt
name: run terraform fmt
entry: ./scripts/tffmt.sh
language: system
files: (\.tf|\.tfvars|\.hcl)$
exclude: \.terraform\/.*$
- id: tflint
name: run tflint
entry: ./scripts/tflint.sh
language: system
files: (\.tf|\.tfvars|\.hcl)$
exclude: \.terraform\/.*$
# チェックに1分以上かかるのでCIに任せる
# - id: terraform-validate
# name: run terraform validate
# entry: ./scripts/tfvalidate.sh
# language: system
# files: (\.tf|\.tfvars|\.hcl)$
# exclude: \.terraform\/.*$
# trivy
- repo: local
hooks:
# 脆弱性DBのアップデートなどが発生する場合、チェックに時間がかかるので必要に応じてCIに任せる
# ただしその場合でもsecretスキャンだけはローカルで行うべき
- id: trivy
name: run trivy
entry: ./scripts/trivy.sh
language: system
always_run: true