-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
49 lines (45 loc) · 2.13 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
49 lines (45 loc) · 2.13 KB
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
repos:
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
rev: 'v6.0.0'
hooks:
- id: 'check-added-large-files'
- id: 'check-ast'
- id: 'check-merge-conflict'
- id: 'debug-statements'
# Unit-test fixtures are verbatim captures of what a command, an endpoint or a
# configuration file really contains, down to a missing trailing newline or a
# line carrying a single space. Both are what the test asserts on, so neither
# hook may normalise them.
- id: 'end-of-file-fixer'
exclude: '/unit-test/(config|fixtures|retc|stderr|stdout)/'
- id: 'trailing-whitespace'
exclude: '/unit-test/(config|fixtures|retc|stderr|stdout)/'
- repo: 'https://github.com/astral-sh/ruff-pre-commit'
rev: 'v0.16.9'
hooks:
- id: 'ruff-check'
args: ['--fix']
- id: 'ruff-format'
# pylint is deliberately not run as a hook. Without a configuration it failed on
# every module: the metric checks (C0302 module lines, R0911 returns, R0913
# arguments, R0914 locals) fire on the larger modules by design, C0415 flags the
# imports that are deferred on purpose to keep consumers starting fast, and C0301
# measures against pylint's own 100-character default while the house limit is the
# 88 characters ruff enforces. Its error checks add false positives on top: E1129
# and W0632 cannot follow the `(success, result)` return convention, and E0401 only
# reflects the hook's isolated environment, which lacks httpx, pypsrp and
# testcontainers. Suppressing that much would leave pylint without a job here, so
# it stays a manual, per-module audit tool, the same reasoning that keeps it out of
# `tools/run-linter-checks` and out of the hook set of the monitoring-plugins repo.
- repo: 'https://github.com/PyCQA/bandit'
rev: '1.9.4'
hooks:
- id: 'bandit'
args: ['-c', 'pyproject.toml', '--severity-level=low', '--confidence-level=low']
additional_dependencies: ['bandit[toml]']
types_or: ['python']
- repo: 'https://github.com/jendrikseipp/vulture'
rev: 'v2.16'
hooks:
- id: 'vulture'
types_or: ['python']