-
Notifications
You must be signed in to change notification settings - Fork 3
/
.pre-commit-config.yaml
148 lines (129 loc) · 3.86 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
---
# 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
exclude: '^.*\.patch|^frontend/src/apis/notifications/.*$'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
# "Check for added large files"
- id: check-added-large-files
# "Check for merge conflicts"
- id: check-merge-conflict
# "Check Yaml"
- id: check-yaml
args:
# Allow custom tags like Gitlab's "!reference" tag.
- --unsafe
exclude: ^helm/.+/templates/
# prettify JSON
- id: check-json
exclude: "conffiles/.*[.]json$"
- id: pretty-format-json
exclude: "conffiles/.*[.]json$"
args:
- --autofix
- --no-ensure-ascii
# "Fix python encoding pragma"
# - id: fix-encoding-pragma
# "Trim Trailing Whitespace"
- id: trailing-whitespace
# "Python blocks in UCR config templates"
- repo: https://git.knut.univention.de/univention/dist/pre-commit-ucr
rev: "0.0.10"
hooks:
- id: ucr-flake8
- id: ucr-ruff
- id: ucr-autopep8
stages: [manual]
- id: ucr-ruff-fix
stages: [manual]
# "Commit messages"
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.0.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
# "Debian package related control fiels"
- repo: https://git.knut.univention.de/univention/dist/pre-commit-debian.git
rev: v1.1.0
hooks:
- id: debian-control
# "flake8"
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
- repo: https://github.com/charliermarsh/ruff-pre-commit
# TODO: Updating Ruff does include making the linter work by either
# correcting the code or adjusting the configuration.
# rev: "v0.1.9"
rev: "v0.0.246"
hooks:
- id: ruff
- id: ruff
alias: "ruff-fix"
stages: [manual]
args: ["--fix"]
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v2.0.4
hooks:
- id: autopep8
args: ["-d"]
- id: autopep8
alias: "autopep8-fix"
stages: [manual]
args: ["-i"]
- repo: https://gitlab.com/univention/pre-commit-hooks/pre-commit-shell
rev: v1.0.6+uv1
hooks:
- id: shell-lint
args:
- -e
- SC1091
# "docker-compose.yaml linter"
- repo: https://gitlab.com/univention/pre-commit-hooks/docker-compose-check
rev: 7702a8801a158b8595569dd29e2dd655d8a08310
hooks:
- id: docker-compose-check
# "Dockerfile linter"
- repo: https://gitlab.com/univention/pre-commit-hooks/docker-pre-commit
rev: v2.0.0
hooks:
- id: hadolint-system
args:
- "--ignore=DL3008"
# "Helm chart linter"
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.23
hooks:
- id: helmlint
# Disable temporarily because gitlab-api can not be accessed.
# "urllib.error.HTTPError: HTTP Error 401: Unauthorized"
# ".gitlab-ci.yml linter"
# - repo: https://gitlab.com/univention/pre-commit-hooks/gitlab-ci-linter
# rev: v1.0.1
# hooks:
# - id: gitlab-ci-linter
# args:
# - '--server'
# - 'https://git.knut.univention.de'
- repo: https://github.com/norwoodj/helm-docs
rev: v1.12.0
hooks:
- id: helm-docs
args:
- --chart-search-root=helm
- --template-files=README.md.gotmpl
always_run: true
- repo: "https://git.knut.univention.de/univention/dist/pre-commit-hooks/addlicense"
rev: "v1.0.1"
hooks:
- id: "addlicense"
- repo: "https://git.knut.univention.de/univention/customers/dataport/upx/kyverno-test-pre-commit"
rev: "v0.2.0"
hooks:
- id: kyverno-test
...