-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
216 lines (199 loc) · 6.82 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
---
# Source: https://pre-commit.com/hooks.html
# pre-commit install
# pre-commit autoupdate
# detect-secrets scan > .secrets.baseline
# pre-commit run --all-files --verbose
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
description: Trims trailing whitespace.
- id: end-of-file-fixer
description: Makes sure files end in a newline and only a newline.
exclude: .cache_ggshield
- id: double-quote-string-fixer
- id: debug-statements
verbose: true
- id: name-tests-test
verbose: true
- id: requirements-txt-fixer
verbose: true
- id: check-added-large-files
args: [--maxkb=10000]
verbose: true
log_file: 'true'
- id: check-xml
verbose: true
# - id: check-yaml
# verbose: true
# args: [--allow-multiple-documents]
- id: check-json
verbose: true
- id: pretty-format-json
args: [--autofix]
verbose: true
- id: detect-aws-credentials
# - id: detect-private-key
# exclude: gitleaks-report.json
- id: check-merge-conflict
# - id: check-vcs-permalinks
- id: forbid-new-submodules
- id: no-commit-to-branch
args: ['--branch', 'master']
- id: check-executables-have-shebangs
# Cross platform
- id: mixed-line-ending
args: [--fix=lf]
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: forbid-crlf
name: pre-commit-hooks (Lucas-C - useful git hooks)
verbose: true
- id: remove-crlf
description: Remove CRLF Line breaks
exclude: .pre-commit-config.yaml
- id: forbid-tabs
verbose: true
- id: remove-tabs
verbose: true
args: [--whitespaces-count, '2'] # defaults to: 4
# - id: chmod
# args: ['644']
# files: \.md$
# - id: insert-license
# files: \.groovy$
# args:
# - --license-filepath
# - src/license_header.txt # defaults to: LICENSE.txt
# - --comment-style
# - // # defaults to: #
# - --use-current-year
# - --no-extra-eol # see below
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.7.0
hooks:
- id: setup-cfg-fmt
name: setup-cfg-fmt (apply a consistent format to setup.cfg files)
- repo: https://github.com/crate-ci/typos
rev: v1.22.9
hooks:
- id: typos
# - id: typos-docker
name: typos (Finds and corrects spelling mistakes)
args: [-v]
exclude: gitleaks-report.json|charts/|helm-template/
# - repo: https://github.com/lyz-code/yamlfix/
# rev: 1.16.0
# hooks:
# - id: yamlfix
# exclude: charts/|helm-template/
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
name: yamllint (linter for YAML files)
args: [--format, auto]
exclude: chartsValues/|template/
- repo: https://github.com/PeterMosmans/jenkinslint
rev: v1.0.0
hooks:
- id: jenkinslint
name: jenkinslint (basic Jenkinsfile linter)
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.14.0
hooks:
- id: reorder-python-imports
name: reorder-python-imports (Tool for automatically reordering python imports)
args: [--py39-plus, --add-import, from __future__ import annotations]
exclude: ^(pre_commit/resources/|testing/resources/python3_hooks_repo/)
- repo: https://github.com/hhatto/autopep8
rev: v2.3.1
hooks:
- id: autopep8
name: autopep8 (Style Guide Enforcement)
# - repo: https://github.com/pryorda/dockerfilelint-precommit-hooks
# rev: v0.1.0
# hooks:
# - id: dockerfilelint
# name: dockerfilelint-precommit-hooks (Useful pre-commit hooks for checking
# Dockerfiles)
# stages: [commit]
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
name: detect-secrets (module for detecting secrets)
args:
- --baseline
- .secrets.baseline
exclude: gitleaks-report.json|chartsValues/|template/
- repo: https://github.com/zricethezav/gitleaks
rev: v8.21.2
hooks:
- id: gitleaks
name: gitleaks
description: Gitleaks is for detecting and preventing hardcoded secrets
args: [--no-banner, --config=.gitleaks.toml]
# - id: gitleaks-docker
# name: gitleaks-docker
# description: Detect hardcoded system docker secrets using Gitleaks
# args: [--no-banner, --config=.gitleaks.toml]
# - id: gitleaks-system
# name: Detect hardcoded secrets
# description: Detect hardcoded system secrets using Gitleaks
# args: [--no-banner, --config=.gitleaks.toml]
- repo: https://github.com/thoughtworks/talisman
rev: v1.32.0
hooks:
- id: talisman-commit
name: talisman (scans git to ensure that potential secrets or sensitive information)
entry: cmd --githook pre-commit
# exclude: 'chartsValues/|template'
# - repo: https://github.com/gitguardian/ggshield # need token for use
# rev: v1.28.0
# hooks:
# - id: ggshield
# verbose: false
# - id: docker-ggshield
# name: ggshield (CI environment to detect secrets)
# always_run: true
- repo: https://github.com/norwoodj/helm-docs
rev: v1.14.2
hooks:
- id: helm-docs
name: helm-docs (auto-generates documentation from helm charts into markdown)
# args: ['--chart-search-root=chartsValues']
exclude: '(charts|helm-template)/.*'
# - repo: https://github.com/jumanjihouse/pre-commit-hooks
# rev: 3.0.0
# hooks:
# - id: shfmt
# name: shfmt (format shell scripts using the shfmt tool.)
# args: ['-l', '-i', '2', '-ci', '-sr', '-w']
# exclude: 'charts/.*|helm-template/.*'
# verbose: true
# - id: shellcheck
# verbose: true
# - repo: https://github.com/hadolint/hadolint
# rev: v2.13.0-beta
# hooks:
# - id: hadolint
# args: [
# '--ignore', 'DL3007', # Using latest
# '--ignore', 'DL3013', # Pin versions in pip
# '--ignore', 'DL3027', # Do not use apt
# '--ignore', 'DL3059', # Docker `RUN`s shouldn't be consolidated here
# '--ignore', 'DL4006', # Not related to alpine
# '--ignore', 'SC1091', # Useless check
# '--ignore', 'SC2015', # Useless check
# '--ignore', 'SC3037', # Not related to alpine
# ]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
# https://prettier.io/docs/en/options.html#parser
files: '.json5$'