-
Notifications
You must be signed in to change notification settings - Fork 6
/
.pre-commit-config.yaml
112 lines (111 loc) · 3.68 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
# 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
- id: trailing-whitespace
- 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
- id: ruff
alias: "ruff-edit"
stages: [manual]
args: ["--fix", "--unsafe-fixes"]
- id: ruff-format
alias: "ruff-format"
stages: [manual]
- id: ruff-format
alias: "ruff-format-check"
stages: [manual]
args: ["--check"]
- 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 --check --diff --config .black
- id: black
additional_dependencies: ["click>8.0,<8.1"]
alias: black-edit
stages: [manual]
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: 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: 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