This repository has been archived by the owner on Nov 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path.pre-commit-config.yaml
212 lines (212 loc) · 6.2 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
# vi: ft=yaml.ansible.jinja2
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks.git
# pre-commit-hooks is not working on both environment
# You will have to switch
# pre-commit-hooks.git from v2.1.0 to v2.4.0
# rev: v2.1.0 # ok python3.6 # 18.04.3
# rev: v2.2.3 # ok python3.6 # 19.04 but failing on 18.04.3
# rev: v2.4.0 # ok python3.6 on Ubuntu 18.04 AND python3.7 on Ubuntu 19.04
# rev: v3.4.0 # ok python3.6 on Ubuntu 18.04 AND python3.7 on Ubuntu 19.04 AND python3.8 on Ubuntu 20.04
rev: v4.4.0 # ok python3.6 on Ubuntu 18.04 AND python3.7 on Ubuntu 19.04 AND python3.8 on Ubuntu 20.04
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: check-ast
- id: end-of-file-fixer
- id: check-added-large-files
args: ["--maxkb=123"]
exclude: >
(?x)^(
.pnp.cjs|
package-lock.json|
npm-shrinkwrap.json|
poetry.lock|
Pipfile.lock|
yarn.lock|
)$
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
exclude: >
(?x)^(
clean.bat|
build.bat|
mvnw.cmd|
.mvn/|
.venv|
.direnv|
)$
- id: check-shebang-scripts-are-executable
- id: check-json
exclude: >
(?x)^(
^.vscode/|
.devcontainer/devcontainer.json|
)$
- id: check-symlinks
- id: check-toml
- id: check-xml
- id: check-yaml
args: [--allow-multiple-documents]
exclude: >
(?x)^(
.gitlab-ci.yml|
templates/.*.gitlab-ci.yml| # because of !reference
k8s/.*|
)$
- id: check-symlinks
- id: check-merge-conflict
- id: debug-statements
exclude: ^.cache/
- id: detect-private-key
exclude: >
(?x)^(
.ssh/id_rsa|
roles/jenkins-master/defaults/main.yml|
roles/jenkins-master/README.md|
)$
- id: double-quote-string-fixer
- id: name-tests-test
exclude: >
(?x)^(
molecule/default/tests/.*|
.*test_default\.py|
)$
# - id: no-commit-to-branch
# args: [--branch, develop, --branch, main, --branch, master, --branch, release/*]
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: fix-encoding-pragma
args: [--remove]
- id: requirements-txt-fixer
- id: sort-simple-yaml
- id: file-contents-sorter
- id: mixed-line-ending
args: [--fix=lf]
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v2.0.4
hooks:
- id: autopep8
- repo: https://github.com/pre-commit/pre-commit.git
rev: v4.0.1
hooks:
- id: validate_manifest
- repo: https://github.com/asottile/reorder_python_imports.git
rev: v3.14.0
hooks:
- id: reorder-python-imports
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
hooks:
- id: pyupgrade
- 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.10.0
hooks:
- id: ansible-lint
files: \.(yaml|yml)$
exclude: >
(?x)^(
.travis.yml|
docker/|
requirements.yml|
playbooks/group_vars/all/vault.yml|
.gitlab-ci.yml|
)$
- repo: https://github.com/doublify/pre-commit-hindent.git
rev: b3680b6ebf9f7cf29b19307f246adef66756feef
hooks:
- id: hindent
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.10.0-1
hooks:
- 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|
biscuitcutter.sh|
hooks|
tests/.*
)$
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
hooks:
- id: pyupgrade
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v2.0.4
hooks:
- id: autopep8
- repo: https://github.com/IamTheFij/ansible-pre-commit
rev: v0.1.2
hooks:
- id: encryption-check
- repo: https://github.com/hadolint/hadolint
rev: v2.13.1-beta
hooks:
- id: hadolint-docker
# - repo: https://github.com/gitguardian/ggshield
# rev: v1.10.7
# hooks:
# - id: ggshield
# language_version: python3
# stages: [commit]
# - repo: https://github.com/zricethezav/gitleaks
# rev: v8.15.2
# hooks:
# - id: gitleaks-docker
# entry: zricethezav/gitleaks protect --verbose --redact --staged
# # entry: zricethezav/gitleaks detect --verbose
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.96.2
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
- id: terraform_providers_lock
args:
- --args=-platform=linux_amd64
- id: terraform_tflint
- id: terraform_checkov
args:
- --args=--quiet
- --args=--skip-path ansible/roles/
# - --args=--skip-check CKV2_AWS_8
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
hooks:
- id: check-github-workflows
- repo: https://github.com/oxsecurity/megalinter
rev: v8.3.0
hooks:
- id: megalinter-incremental # Faster, less thorough
stages:
- commit
# - id: megalinter-full # Slower, more thorough
# stages:
# - push
- repo: https://github.com/AlbanAndrieu/nabla-hooks.git
rev: v1.0.5
hooks:
- id: git-branches-check
always_run: true
args: [--max=3]
verbose: true