-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
235 lines (235 loc) · 6.46 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
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
# vi: ft=yaml.ansible.jinja2
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
args: ['--maxkb=123']
exclude: >
(?x)^(
.pnp.cjs|
package-lock.json|
yarn.lock|
npm-shrinkwrap.json|
Pipfile.lock|
poetry.lock
)$
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
exclude: >
(?x)^(
clean.bat|
build.bat|
mvnw.cmd|
.mvn/.*|
)$
- id: check-json
exclude: ^.vscode/
- id: check-xml
- id: check-yaml
exclude: >
(?x)^(
packs/.*|
k8s/.*|
.gitlab-ci.yml|
)$
- id: check-symlinks
- id: check-merge-conflict
- id: debug-statements
- id: detect-private-key
exclude: >
(?x)^(
roles/jenkins-master/defaults/main.yml|
roles/jenkins-master/README.md|
ca.key|
server.key|
)$
- id: double-quote-string-fixer
- id: name-tests-test
exclude: >
(?x)^(
.*/molecule/default/tests/test_default.py|
)$
- id: end-of-file-fixer
- id: fix-encoding-pragma
- id: requirements-txt-fixer
- id: sort-simple-yaml
- id: file-contents-sorter
- repo: https://github.com/pre-commit/pre-commit.git
rev: v3.7.1
hooks:
- id: validate_manifest
- repo: https://github.com/asottile/reorder_python_imports.git
rev: v3.12.0
hooks:
- id: reorder-python-imports
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
- id: add-trailing-comma
- repo: https://github.com/willthames/ansible-lint.git
rev: v24.2.3
hooks:
- id: ansible-lint
files: \.(yaml|yml)$
exclude: >
(?x)^(
.travis.yml|
.gitlab-ci.yml|
packs/.*|
k8s/.*|
docker/.*|
docker-compose/.*|
megalinter-reports/.*|
)$
- repo: https://github.com/doublify/pre-commit-hindent.git
rev: b3680b6ebf9f7cf29b19307f246adef66756feef
hooks:
- id: hindent
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.8.0-1
hooks:
# Choose one of:
# - id: shfmt # native (requires Go to build)
- id: shfmt-docker # Docker image (requires Docker to run)
- repo: https://github.com/detailyang/pre-commit-shell
rev: 1.0.5
hooks:
- id: shell-lint
args: [-x]
exclude: >
(?x)^(
mvnw|
hooks|
)$
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v2.0.4
hooks:
- id: autopep8
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
args: [--max-line-length=88, --max-complexity=30]
- repo: https://github.com/IamTheFij/ansible-pre-commit
rev: v0.1.2
hooks:
- id: encryption-check
exclude: >
(?x)^(
.github/workflows/vault.yml$|
)$
- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
rev: v1.1.2
hooks:
- id: htmllint
args: [--config, .eslintrc.json]
# args: [--config, .htmlhintrc]
files: ^src/
- id: dockerfile_lint
args:
- --permissive
- --verbose
- --dockerfile
- ./docker/ubuntu20/Dockerfile
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
hooks:
- id: mypy
exclude: ^(docs/|example-plugin/|tests/fixtures)
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.23
hooks:
- id: helmlint
- repo: https://github.com/norwoodj/helm-docs
rev: v1.13.1
hooks:
- id: helm-docs
args:
- --chart-search-root=packs/helm-sample/charts
files: (README\.md\.gotmpl|(Chart|requirements|values)\.yaml)$
# - repo: https://github.com/bridgecrewio/checkov.git
# rev: '2.0.1159' # change to tag or sha
# hooks:
# - id: checkov
# verbose: true
# args: [--soft-fail]
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.89.1
hooks:
- id: terraform_fmt
- id: terraform_docs
# - id: terraform_validate
# args:
# - --init-args=-lockfile=readonly
# - id: terraform_tfsec
# args:
# - --args=--config-file=tfsec.yml
# - --args=-m HIGH
# - --args=--exclude-path=network/example
# - --args=--tfvars-file=terraform.tfvars
- id: terraform_providers_lock
args:
- --args=-platform=linux_amd64
# - id: terraform_tflint
# - id: terraform_checkov
# args:
# - --args=--quiet
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.3
hooks:
- id: check-github-workflows
- id: check-gitlab-ci
# - repo: https://github.com/Checkmarx/kics
# rev: "v1.5.10"
# hooks:
# #- id: kics
# # exclude: >
# # (?x)^(
# # .direnv$|
# # .*\.terraform.*$|
# # .*\.tfvars$|
# # )$
# - id: kics-scan
# verbose: true
# args: [--ignore-on-exit, "all", --config, "kics-config.json"]
# - repo: https://github.com/hadolint/hadolint
# rev: v2.10.0
# hooks:
# - id: hadolint-docker
# - repo: https://github.com/zricethezav/gitleaks
# rev: v8.15.2
# hooks:
# - id: gitleaks-docker
# entry: zricethezav/gitleaks protect --verbose --redact --staged
# - repo: https://github.com/bridgecrewio/checkov.git
# rev: "2.2.120"
# hooks:
# - id: checkov
# verbose: true
# always_run: true
# #args: [--soft-fail]
- repo: https://github.com/oxsecurity/megalinter
rev: v7.11.1
hooks:
- id: megalinter-incremental # Faster, less thorough
stages:
- commit
# - id: megalinter-full # Slower, more thorough
# stages:
# - push
- repo: https://github.com/AlbanAndrieu/nabla-hooks
rev: v1.0.4
hooks:
- id: git-branches-check
always_run: false
args: [--max=3]
verbose: true