-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config-legacy.yaml
204 lines (185 loc) · 6.15 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
---
# 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:
- 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"
args:
- "--allow-multiple-documents"
# Allow custom tags like Gitlab's "!reference" tag.
- "--unsafe"
exclude: "^helm/.+/templates/"
- 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"
- repo: "https://github.com/adrienverge/yamllint"
rev: "v1.33.0"
hooks:
- id: "yamllint"
name: "yamllint"
args:
- "--config-file=.yamllint"
- "--format=parsable"
# TODO: replace no-warnings with strict
- "--no-warnings"
- repo: "https://github.com/google/yapf"
rev: "v0.40.2"
hooks:
- id: "yapf"
name: "yapf"
# TODO: remove exclude
exclude: '^(docs/conf\.py$|tests/)'
- repo: "https://github.com/astral-sh/ruff-pre-commit"
rev: "v0.1.9"
hooks:
- id: "ruff"
name: "ruff"
# TODO: remove exclude
exclude: '^(tests/best_practices/test_image_configuration\.py|tests/conftest\.py)$'
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"
args:
- "--in-place"
- "--aggressive"
- "--aggressive"
- "--experimental"
- repo: "https://github.com/PyCQA/flake8"
rev: "6.1.0"
hooks:
- id: "flake8"
name: "flake8"
# TODO: remove args
args:
- "--max-line-length=101"
# F541 f-string is missing placeholders
# W503 line break before binary operator
- "--ignore=F541,W503"
- repo: "https://github.com/pylint-dev/pylint"
rev: "v3.0.3"
hooks:
- id: "pylint"
name: "pylint"
additional_dependencies:
# TODO: check if this is the right jsonpath module
- "jsonpath"
- "pytest"
- "pyyaml"
- "sphinx"
# TODO: remove args
args:
- "--max-line-length=101"
# C0103: Constant name "<name>" 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"
# E1101: Module 'jsonpath' has no 'match' member (no-member)
- "--disable=no-member"
# W0511: TODO: <text> (fixme)
- "--disable=fixme"
# W0621: Redefining name 'chart_path' from outer scope (line 15) (redefined-outer-name)
- "--disable=redefined-outer-name"
# W1309: Using an f-string that does not have any interpolated variables (f-string-without-interpolation)
- "--disable=f-string-without-interpolation"
- repo: "https://github.com/hadolint/hadolint"
rev: "v2.12.0"
hooks:
- id: "hadolint"
name: "Lint Dockerfiles"
types: ["dockerfile"]
args:
- "--no-color"
- "--strict-labels"
- repo: "https://gitlab.com/univention/pre-commit-hooks/docker-compose-check"
rev: "7702a8801a158b8595569dd29e2dd655d8a08310"
hooks:
- id: "docker-compose-check"
name: "Validate docker-compose files (python)"
# 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)"
- repo: "https://gitlab.com/univention/pre-commit-hooks/pre-commit-shell"
rev: "v1.0.6+uv1"
hooks:
- id: "shell-lint"
name: "Shell Syntax Check"
args:
- "--enable=all"
- "--external-sources"
- repo: "https://github.com/gruntwork-io/pre-commit"
rev: "v0.1.23"
hooks:
- id: "shellcheck"
name: "Shellcheck Bash Linter"
args:
- "--enable=all"
- 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"
...