-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.pre-commit-config-legacy.yaml
233 lines (212 loc) · 6.9 KB
/
.pre-commit-config-legacy.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
---
# SPDX-FileCopyrightText: 2023-2024 Univention GmbH
# SPDX-License-Identifier: AGPL-3.0-only
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
# "Copy .env.udm-rest-api.example so that docker-compose.yaml can be linted"
- repo: "local"
hooks:
- id: "copy-udm-rest-api"
name: "copy-udm-rest-api"
entry: "sh -c 'if [ ! -f .env.udm-rest-api ]; then cp .env.udm-rest-api.example .env.udm-rest-api; fi'"
language: "system"
files: "docker-compose.yaml"
pass_filenames: false
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: "v4.5.0"
hooks:
- id: "check-added-large-files"
name: "check for added large files"
- id: "check-ast"
name: "check python ast"
- id: "check-case-conflict"
name: "check for case conflicts"
- id: "check-docstring-first"
name: "check docstring is first"
- id: "check-executables-have-shebangs"
name: "check that executables have shebangs"
- id: "check-json"
name: "check json"
- id: "check-merge-conflict"
name: "check for merge conflicts"
- id: "check-yaml"
name: "check yaml"
exclude: "^helm/.+/templates/"
args:
- "--allow-multiple-documents"
# Allow custom tags like Gitlab's "!reference" tag.
- "--unsafe"
- id: "check-symlinks"
name: "check for broken symlinks"
- id: "detect-private-key"
name: "detect private key"
- id: "end-of-file-fixer"
name: "fix end of files"
exclude: "^helm/.+/README.md$"
- id: "fix-byte-order-marker"
name: "fix utf-8 byte order marker"
- id: "trailing-whitespace"
name: "trim trailing whitespace"
- repo: "https://github.com/compilerla/conventional-pre-commit"
rev: "v3.0.0"
hooks:
- id: "conventional-pre-commit"
name: "Conventional Commit"
stages: ["commit-msg"]
- repo: "https://git.knut.univention.de/univention/dist/pre-commit-hooks/addlicense"
rev: "v1.0.1"
hooks:
- id: "addlicense"
name: "Check or add license headers to files"
types_or:
- "dockerfile"
- "python"
- "yaml"
- repo: "https://github.com/adrienverge/yamllint"
rev: "v1.33.0"
hooks:
- id: "yamllint"
name: "yamllint"
types:
- "yaml"
exclude: "^helm/.+/templates/"
args:
- "--config-file=.yamllint"
- "--format=parsable"
# TODO replace no-warnings with strict
# - "--strict"
- "--no-warnings"
- repo: "https://github.com/google/yapf"
rev: "v0.40.2"
hooks:
- id: "yapf"
name: "yapf"
types:
- "python"
exclude: "^(docs/conf.py|tests/integration/conftest.py|tests/integration/test_users_user.py)"
- repo: "https://github.com/astral-sh/ruff-pre-commit"
rev: "v0.1.9"
hooks:
- id: "ruff"
name: "ruff"
types:
- "python"
args:
- "--fix"
- "--show-source"
- "--exit-non-zero-on-fix"
- "--extend-select=COM"
- repo: "https://github.com/hhatto/autopep8"
rev: "v2.0.4"
hooks:
- id: "autopep8"
name: "autopep8"
types:
- "python"
args:
- "--in-place"
- "--aggressive"
- "--aggressive"
- "--experimental"
- repo: "https://github.com/PyCQA/flake8"
rev: "6.1.0"
hooks:
- id: "flake8"
name: "flake8"
types:
- "python"
- repo: "https://github.com/pylint-dev/pylint"
rev: "v3.0.3"
hooks:
- id: "pylint"
name: "pylint"
types:
- "python"
additional_dependencies:
- "pytest"
- "requests"
- "sphinx"
# TODO: remove args
args:
# C0103: Constant name "pdf_doc_base" doesn't conform to UPPER_CASE naming style (invalid-name)
- "--disable=invalid-name"
# C0114: Missing module docstring (missing-module-docstring)
- "--disable=missing-module-docstring"
# C0116: Missing function or method docstring (missing-function-docstring)
- "--disable=missing-function-docstring"
# C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
- "--disable=consider-using-f-string"
# E1101: Instance of '<class>' has no '<member>' member (no-member)
- "--disable=no-member"
# W0621: Redefining name 'session' from outer scope (line 55) (redefined-outer-name)
- "--disable=redefined-outer-name"
# W0622: Redefining built-in 'copyright' (redefined-builtin)
- "--disable=redefined-builtin"
- repo: "https://github.com/hadolint/hadolint"
rev: "v2.12.0"
hooks:
- id: "hadolint"
name: "Lint Dockerfiles"
types:
- "dockerfile"
args:
- "--no-color"
- "--strict-labels"
# DL3050 info: Superfluous label(s) present.
- "--ignore=DL3050"
- "--ignore=DL3008"
- repo: "https://gitlab.com/univention/pre-commit-hooks/docker-compose-check"
rev: "7702a8801a158b8595569dd29e2dd655d8a08310"
hooks:
- id: "docker-compose-check"
name: "Validate docker-compose files (python)"
types:
- "yaml"
# Cloned from github.com/IamTheFij/docker-pre-commit
- repo: "https://gitlab.com/univention/pre-commit-hooks/docker-pre-commit"
rev: "v3.0.1"
hooks:
- id: "docker-compose-check"
name: "Validate docker compose files (bash)"
types:
- "yaml"
- repo: "https://gitlab.com/univention/pre-commit-hooks/pre-commit-shell"
rev: "v1.0.6+uv1"
hooks:
- id: "shell-lint"
name: "Shell Syntax Check"
types:
- "shell"
args:
- "--enable=all"
- "--external-sources"
# SC2250 (style): Prefer putting braces around variable references even when not strictly required.
- "--exclude=SC2250"
- repo: "https://github.com/gruntwork-io/pre-commit"
rev: "v0.1.23"
hooks:
- id: "helmlint"
name: "helmlint"
- repo: "https://github.com/norwoodj/helm-docs"
rev: "v1.12.0"
hooks:
- id: "helm-docs"
name: "Helm Docs"
args:
- "--chart-search-root=helm"
- "--template-files=README.md.gotmpl"
always_run: true
# Uses `GITLAB_SERVER`, `GITLAB_PROJECT_ID` and `GITLAB_PRIVATE_TOKEN`
- repo: "https://gitlab.com/univention/pre-commit-hooks/gitlab-ci-linter"
rev: "v1.0.6+uv2"
hooks:
- id: "gitlab-ci-linter"
name: ".gitlab-ci.yml linter"
stages:
- "manual"
- repo: "https://git.knut.univention.de/univention/customers/dataport/upx/kyverno-test-pre-commit"
rev: "v0.3.0"
hooks:
- id: "kyverno-test"
...