-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.pre-commit-config.yaml
147 lines (146 loc) · 4.88 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: "^django-pam/"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
- id: check-json
- id: check-xml
- id: check-yaml
exclude: ".gitlab-ci/gitlab-ci.yml"
- id: check-shebang-scripts-are-executable
files: ^ucs-school-import-lusd/.*
- id: check-executables-have-shebangs
files: ^ucs-school-import-lusd/.*
- id: trailing-whitespace
- id: pretty-format-json
args: [--autofix]
files: ^ucs-school-import-lusd/.*
- repo: https://git.knut.univention.de/univention/dist/pre-commit-ucr
rev: "0.0.10"
hooks:
- id: ucr-flake8
additional_dependencies: ["flake8==5.0.4"]
- id: ucr-ruff
additional_dependencies: ["ruff==0.2.2"]
- id: ucr-autopep8
additional_dependencies: ["autopep8<=2.0.2"]
stages: [manual]
- id: ucr-ruff-fix
additional_dependencies: ["ruff==0.2.2"]
stages: [manual]
- id: ucr-ruff-format-check
additional_dependencies: ["ruff==0.2.2"]
stages: [manual]
- id: ucr-ruff-format
additional_dependencies: ["ruff==0.2.2"]
stages: [manual]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.2.2"
hooks:
- id: ruff
args: ["--fix"]
- id: ruff
alias: "ruff-unsafe"
stages: [manual]
args: ["--fix", "--unsafe-fixes"]
- id: ruff-format
alias: "ruff-format"
stages: [manual]
- repo: https://github.com/psf/black
# Until all Python 3 incompatible code has been removed (-> u"") we have to stay at 21.9b0.
# Version 21.11b0 adds super annoying Python 2 deprecation notice.
# Version 22.1.0 removes Python 2 support.
rev: 21.9b0
hooks:
- id: black
additional_dependencies: ["click>8.0,<8.1"]
entry: black --config .black
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
# pygrep does not install an environment, so cannot use a language version.
- id: python-check-blanket-noqa
- id: python-no-eval
- id: rst-backticks
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
entry: bandit -c .bandit --exclude ucs-test-ucsschool
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
hooks:
- id: mypy
files: ^ucs-school-import-lusd/.*
language_version: python3.8
additional_dependencies:
- types-requests==2.32.0.20240712
- pytest==8.3.2
args: ["--strict", "--ignore-missing-imports"]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
files: ^ucs-school-import-lusd/.*
language_version: python3.8
- repo: https://git.knut.univention.de/univention/dist/pre-commit-debian.git
rev: v1.1.0
hooks:
- id: debian-control
exclude: ^(?!ucs-school-import-lusd\/).*$
- id: debian-changelog
exclude: ^(?!ucs-school-import-lusd\/).*$
- repo: local
hooks:
- id: advisorycheck
name: Check YAML errata advisories
entry: ./.gitlab-ci/validate-advisories
language: python
types: ["yaml"]
files: doc/errata/staging/.*
exclude: doc/errata/staging/0template.yaml
additional_dependencies:
- pyyaml==6.0
- repo: local
hooks:
- id: changelogchecks
name: Checks on changelog modification
entry: ./.gitlab-ci/changelog-checks
language: python
files: ucs-.*/debian/changelog
exclude: ucs-test-ucsschool/debian/changelog
additional_dependencies:
- pyyaml==6.0
- gitpython==3.1.43
- python-debian==0.1.49
- repo: https://github.com/jackdewinter/pymarkdown
rev: v0.9.7
hooks:
- id: pymarkdown
# Pymarkdown only supports python >= 3.8.
# Let's be explicit about which version we're testing with.
language_version: python3.8
# TODO: clean those up:
exclude: "^doc/devel/README.*.md$\
|^(CODE_OF_CONDUCT|CONTRIBUTING|PULL_REQUEST_TEMPLATE|README).md$\
|^ucs-school-import/.*.md$\
|^.gitlab/issue_templates/default.md$\
"
args:
- --disable-rules
- MD013,MD024,MD034
- scan
# Rules pymarkdown: https://github.com/jackdewinter/pymarkdown/blob/main/docs/rules.md
# Rules markdownlint: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
# MD013: Allow arbitrary line length
# MD024: Allow duplicate headings
# MD034: Allow bare URLs
default_language_version:
python: python3.7