-
Notifications
You must be signed in to change notification settings - Fork 468
/
.pre-commit-config.yaml
131 lines (131 loc) · 4.19 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
#
# This is the configuration file for the pre-commit framework.
# To use this you need to install it seperately and activate it for your repository.
# To do so issue the following commands:
#
# pip3 install pre-commit
#
# and in your repository
#
# pre-commit install
#
# That's it. You're done.
#
default_stages:
- commit
- push
- manual
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.4.4'
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-merge-conflict
types: [file]
- id: check-yaml # pre-commit cannot parse utf-16 files
exclude: |
(?x)(
^agents/wnx/test_files/config/check_mk_dev_malformed.yml|
^agents/wnx/test_files/config/check_mk_dev_utf16.yml
)
- id: end-of-file-fixer
exclude: .werks/.*
- id: fix-encoding-pragma
args: ["--remove"]
exclude: |
(?x)^(
^agents/plugins/|
^non-free/cmk-update-agent/|
^tests/agent-plugin-unit/
)
- repo: https://github.com/gitleaks/gitleaks
rev: v8.16.1
hooks:
- id: gitleaks
- repo: local
hooks:
- id: check-cmk-namespace
name: Check cmk namespace package
language: script
entry: scripts/check-cmk-namespace
types: [file, python]
- id: remove-stale-imports
name: Remove stale imports
language: script
entry: scripts/run-autoflake
types: [file, python]
- id: bandit
name: Run bandit
# -l level low -ll = level medium -lll level high
entry: scripts/run-pipenv run bandit --config bandit.yaml -ll
language: script
types: [file, python]
- id: omd-python-modules
name: Check Python modules in OMD
entry: scripts/check-omd-python-modules
language: script
files: omd/packages/python3?-modules
types: [file]
- id: sphinx
name: Sphinx Documentation
entry: scripts/run-pipenv run make -C doc/documentation html
files: ^doc/documentation/.*(rst|puml)$
pass_filenames: false
language: script
types: [file]
- id: pylint
name: Check pylint
entry: scripts/check-pylint
language: script
types: [file, python]
- id: doctest
name: Doctests
entry: scripts/run-doctests
language: script
types: [file, python]
verbose: true
- id: mypy
name: Check types with mypy
entry: scripts/run-mypy
language: script
types: [file, python]
- id: licence
name: Check licence headers
entry: scripts/check-licence
language: script
types: [file, python]
- id: absolute-imports
name: Check absolute imports
entry: scripts/check-absolute-imports.py
language: script
types: [file, python]
- id: flake8
name: Check flake8
entry: scripts/check-flake8
language: script
types: [file, python]
verbose: true
- id: unittest
name: unittests
entry: scripts/run-unittests
language: script
types: [file, python]
verbose: true
- id: buildifier_format
name: Format bazel files
entry: scripts/run-buildifier
language: script
types: ["bazel", "file", "non-executable", "text"]
verbose: true
- id: buildifier_lint
name: Lint bazel files
entry: scripts/run-buildifier
args: ["--lint=warn"]
language: script
types: ["bazel", "file", "non-executable", "text"]
verbose: true