-
Notifications
You must be signed in to change notification settings - Fork 68
/
.pre-commit-config.yaml
175 lines (175 loc) · 6.4 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: "^packaging/ucslint/testframework/\
|^services/univention-ldb-modules/buildtools/\
|^services/univention-ldb-modules/third_party/
"
repos:
- repo: https://git.knut.univention.de/univention/dist/pre-commit-ucr
rev: '0.1.0'
hooks:
- id: ucr-flake8
additional_dependencies: ["flake8==5.0.4"]
- id: ucr-ruff
additional_dependencies: ["ruff==0.3.2"]
- id: ucr-autopep8
additional_dependencies: ["autopep8<=2.0.2"]
stages: [ manual ]
- id: ucr-ruff-fix
additional_dependencies: ["ruff==0.3.2"]
stages: [ manual ]
- id: ucr-ruff-format-check
additional_dependencies: ["ruff==0.3.2"]
stages: [ manual ]
- id: ucr-ruff-format
additional_dependencies: ["ruff==0.3.2"]
stages: [ manual ]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-json
exclude: "/conffiles/.*[.]json$"
- id: check-xml
exclude: "/conffiles/.*[.]xml$\
"
- id: check-yaml
exclude: "/conffiles/.*[.]yaml$|[.]gitlab-ci/base-doc[.]yml$"
- id: check-merge-conflict
- id: pretty-format-json
exclude: "/conffiles/.*[.]json$\
"
args:
- --autofix
- --no-ensure-ascii
- id: trailing-whitespace
exclude: "^base/univention-config-registry/tests/unwrap/\
|^base/univention-lib/unittests/fstab$\
|^base/univention-system-setup/city-data/.*[.](txt|json)$\
|^doc/errata/staging/0.*template[.]yaml$\
|^services/univention-ldb-modules/buildtools/\
|^services/univention-ldb-modules/third_party/\
|[.]ai$\
|[.]csv$\
|[.]diff$\
|[.]patch$\
|[.]svg$\
"
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-no-eval
exclude: "^management/univention-directory-manager-modules/modules/univention/admin/__init__.py\
|^services/univention-ldb-modules/buildtools/\
|^services/univention-ldb-modules/third_party/\
|^test/ucs-test/tests/10_ldap/52listener-filter.py\
|^packaging/univention-l10n/univention/l10n/umc.py"
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/pycqa/flake8
rev: '7.0.0'
hooks:
- id: flake8
exclude: "^services/univention-ldb-modules/buildtools/\
|^services/univention-ldb-modules/third_party/\
|^packaging/ucslint/testframework/\
"
- repo: https://git.knut.univention.de/univention/dist/pre-commit-debian.git
rev: v1.1.0
hooks:
- id: debian-control
- id: debian-changelog
- repo: https://git.knut.univention.de/univention/dist/pre-commit-ucs.git
rev: v1.4.0
hooks:
- id: missing-executable-flag-for-python-file
- id: missing-executable-flag-for-shell-file
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.0
hooks:
- id: check-gitlab-ci
- id: check-jsonschema
alias: check-jsonschema-releases
name: "Check errata file"
files: ^doc/errata/staging/[^0].*[.]yaml$
args: ["--schemafile", "https://git.knut.univention.de/univention/dist/repo-ng/-/raw/master/doc/erratum.schema.json?ref_type=heads"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.3.2'
hooks:
- id: ruff
exclude: "^services/univention-ldb-modules/buildtools/\
|^services/univention-ldb-modules/third_party/\
|^packaging/ucslint/testframework/\
"
- id: ruff
alias: "ruff-fix"
stages: [ manual ]
args: ["--fix", "--unsafe-fixes"]
exclude: "^services/univention-ldb-modules/buildtools/\
|^services/univention-ldb-modules/third_party/\
|^packaging/ucslint/testframework/\
"
- id: ruff
alias: "ruff-statistics"
stages: [ manual ]
args: ["--statistics"]
exclude: "^services/univention-ldb-modules/buildtools/\
|^packaging/ucslint/testframework/\
"
- id: ruff
alias: "ruff-select"
stages: [ manual ]
args: ["--select", "CPY001"]
exclude: "^oidc/python-keycloak/\
|^services/univention-ldb-modules/buildtools/\
|^packaging/ucslint/testframework/\
"
- id: ruff-format
alias: "ruff-format"
stages: [ manual ]
exclude: "^services/univention-ldb-modules/buildtools/\
|^packaging/ucslint/testframework/\
"
- id: ruff-format
alias: "ruff-format-check"
stages: [ manual ]
args: ["--check"]
exclude: "^services/univention-ldb-modules/buildtools/\
|^packaging/ucslint/testframework/\
"
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
entry: isort -c
exclude: "^services/univention-ldb-modules/buildtools/\
|^services/univention-ldb-modules/third_party/\
|^packaging/ucslint/testframework/\
"
- id: isort
alias: "isort-fix"
stages: [ manual ]
entry: isort
exclude: "^services/univention-ldb-modules/buildtools/\
|^services/univention-ldb-modules/third_party/\
|^packaging/ucslint/testframework/\
"
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v2.0.4
hooks:
- id: autopep8
args: ["-d"]
exclude: "^services/univention-ldb-modules/buildtools/\
|^services/univention-ldb-modules/third_party/\
|^packaging/ucslint/testframework/\
"
- id: autopep8
alias: "autopep8-fix"
stages: [ manual ]
args: ["-i"]
exclude: "^services/univention-ldb-modules/buildtools/\
|^services/univention-ldb-modules/third_party/\
|^packaging/ucslint/testframework/\
"