-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
236 lines (208 loc) · 7.49 KB
/
.pre-commit-config.yaml
File metadata and controls
236 lines (208 loc) · 7.49 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-merge-conflict
name: Check for merge conflict strings
- id: end-of-file-fixer
name: Fix missing newline at the end of files
- id: check-shebang-scripts-are-executable
name: Check shell scripts are executable
files: \.(sh)$
- id: check-yaml
name: Check pipelines configuration
files: ^(.github)
- repo: https://github.com/pycqa/flake8
rev: "7ef0350a439c93166bc8ba89fcc3de6a9a664e6c" # release 6.1.0
hooks:
- id: flake8
- repo: local
hooks:
- id: grype-scan-local
name: Grype scan local changes
entry: make
args: ["grype-scan-local"]
language: system
pass_filenames: false
always_run: true
- id: check-commit-signing
name: Check commit signing
description: Ensures that commits are GPG signed
entry: bash
args:
- -c
- |
if ! git config --get commit.gpgsign | grep -q "true" > /dev/null 2>&1; then
echo "Error: Commit signing is not enabled."
echo "Please enable commit signing with:"
echo " git config commit.gpgsign true"
echo ""
echo "For more information, see: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits"
exit 1
fi
echo "Commit signing is properly configured."
language: system
pass_filenames: false
always_run: true
- id: lint-cdk
name: Lint cdk
entry: npm
args: ["run", "--prefix=packages/cdk", "lint"]
language: system
files: ^packages\/cdk
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-cpt-ui
name: Lint cpt-ui
entry: npm
args: ["run", "--prefix=packages/cpt-ui", "lint"]
language: system
files: ^packages\/cpt-ui
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-cognito
name: Lint cognito
entry: npm
args: ["run", "--prefix=packages/cognito", "lint"]
language: system
files: ^packages\/cognito
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-pdsClient
name: Lint pdsClient
entry: npm
args: ["run", "--prefix=packages/common/pdsClient", "lint"]
language: system
files: ^packages\/common\/pdsClient
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-middyErrorHandler
name: Lint middyErrorHandler
entry: npm
args: ["run", "--prefix=packages/common/middyErrorHandler", "lint"]
language: system
files: ^packages\/common\/middyErrorHandler
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-commonTypes
name: Lint commonTypes
entry: npm
args: ["run", "--prefix=packages/common/commonTypes", "lint"]
language: system
files: ^packages\/common\/commonTypes
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-lambdaUtils
name: Lint lambdaUtils
entry: npm
args: ["run", "--prefix=packages/common/lambdaUtils", "lint"]
language: system
files: ^packages\/common\/lambdaUtils
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-common-testing
name: Lint common-testing
entry: npm
args: ["run", "--prefix=packages/common/testing", "lint"]
language: system
files: ^packages\/common\/testing
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-prescriptionListLambda
name: Lint prescriptionListLambda
entry: npm
args: ["run", "--prefix=packages/prescriptionListLambda", "lint"]
language: system
files: ^packages\/prescriptionListLambda
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-patientSearchLambda
name: Lint patientSearchLambda
entry: npm
args: ["run", "--prefix=packages/patientSearchLambda", "lint"]
language: system
files: ^packages\/patientSearchLambda
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-trackerUserInfoLambda
name: Lint trackerUserInfoLambda
entry: npm
args: ["run", "--prefix=packages/trackerUserInfoLambda", "lint"]
language: system
files: ^packages\/trackerUserInfoLambda
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-sessionManagementLambda
name: Lint sessionManagementLambda
entry: npm
args: ["run", "--prefix=packages/sessionManagementLambda", "lint"]
language: system
files: ^packages\/sessionManagementLambda
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-CIS2SignOutLambda
name: Lint CIS2SignOutLambda
entry: npm
args: ["run", "--prefix=packages/CIS2SignOutLambda", "lint"]
language: system
files: ^packages\/CIS2SignOutLambda
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-selectedRoleLambda
name: Lint selectedRoleLambda
entry: npm
args: ["run", "--prefix=packages/selectedRoleLambda", "lint"]
language: system
files: ^packages\/selectedRoleLambda
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-authFunctions
name: Lint authFunctions
entry: npm
args: ["run", "--prefix=packages/common/authFunctions", "lint"]
language: system
files: ^packages\/common\/authFunctions
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-doHSClient
name: Lint doHSClient
entry: npm
args: ["run", "--prefix=packages/common/doHSClient", "lint"]
language: system
files: ^packages\/common\/doHSClient
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-dynamoFunctions
name: Lint dynamoFunctions
entry: npm
args: ["run", "--prefix=packages/common/dynamoFunctions", "lint"]
language: system
files: ^packages\/common\/dynamoFunctions
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-githubactions
name: Lint github actions
entry: make
args: ["actionlint"]
language: system
files: ^.github
types_or: [yaml]
pass_filenames: false
- id: lint-githubaction-scripts
name: Lint github action scripts
entry: make
args: ["lint-githubaction-scripts"]
language: system
files: ^.github/scripts
types_or: [sh, shell]
pass_filenames: false
- id: gitleaks
name: Git Leaks
description: gitleaks scans commits, commit messages, and --no-ff merges to prevent adding secrets into your git repositories.
entry: bash
args:
- -c
- "gitleaks git --pre-commit --redact --staged --verbose"
language: system
fail_fast: true
default_stages: [pre-commit]