-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
131 lines (116 loc) · 4.01 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
---
# SPDX-License-Identifier: AGPL-3.0-only
# SPDX-FileCopyrightText: 2023-2024 Univention GmbH
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
# "Copy .env.ldap-server.example so that docker-compose.yaml can be linted"
- repo: "local"
hooks:
- id: "copy-env-ldap-server"
name: "copy-env-ldap-server"
entry: "sh -c 'if [ ! -f .env.ldap-server ]; then cp .env.ldap-server.example .env.ldap-server; fi'"
language: "system"
files: "docker-compose.yaml"
pass_filenames: false
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: "v4.6.0"
hooks:
- id: "check-added-large-files"
name: "check for added large files"
- 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"
# TOD: remove private key
exclude: "ssl/secret/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.3.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.2"
hooks:
- id: "addlicense"
name: "Check or add license headers to files"
- repo: "https://github.com/astral-sh/ruff-pre-commit"
rev: "v0.5.2"
hooks:
- id: "ruff"
args: [ "--fix" ]
- id: "ruff-format"
# TODO: Update hadolint >= v2.12.0 from https://github.com/hadolint/hadolint
- repo: "https://gitlab.com/univention/pre-commit-hooks/docker-pre-commit"
rev: "v2.0.1"
hooks:
- id: "hadolint-system"
name: Lint Dockerfiles
- 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"
# TODO: enable all
- repo: "https://github.com/gruntwork-io/pre-commit"
rev: "v0.1.23"
hooks:
- id: "shellcheck"
name: "Shellcheck Bash Linter"
# TODO: enable all
- id: "helmlint"
name: "helmlint"
- repo: "https://github.com/norwoodj/helm-docs"
rev: "v1.14.2"
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"
...