-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
100 lines (90 loc) · 2.85 KB
/
.pre-commit-config.yaml
File metadata and controls
100 lines (90 loc) · 2.85 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
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
# Pre-commit configuration
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
#
# Ruff hooks use the project venv binary with --config pyproject.toml
# so editor, pre-commit, and CI all use the same root configuration.
repos:
# Built-in hooks (no dependencies needed)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
exclude: ^helmchart/[^/]+/templates/.*\.ya?ml$
- id: check-added-large-files
- id: check-merge-conflict
- id: check-toml
- id: debug-statements
- repo: https://github.com/gitguardian/ggshield
rev: v1.44.1
hooks:
- id: ggshield
# All Python quality checks using uv run (local hooks)
- repo: local
hooks:
# Ruff - Linting
- id: ruff
name: ruff lint
entry: uv run ruff check middleware/
language: system
files: ^middleware/
pass_filenames: false
args: [--fix, --exit-non-zero-on-fix]
# Ruff - Formatting
- id: ruff-format
name: ruff format
entry: uv run ruff format middleware/
language: system
files: ^middleware/
pass_filenames: false
# mypy - Type checking
- id: mypy
name: mypy type check
entry: uv run mypy
language: system
types: [python]
files: ^middleware/
args: [--config-file, pyproject.toml]
# bandit - Security linting
- id: bandit
name: bandit security scan
entry: uv run bandit -r
language: system
types: [python]
files: ^middleware/
args: [--configfile, .bandit]
# pylint - Code quality
- id: pylint
name: pylint
entry: uv run pylint
language: system
types: [python]
files: ^middleware/
# pytest - Unit + integration tests on pre-push
- id: pytest-unit
name: pytest unit and integration tests
entry: bash -c "uv run pytest -m 'not system_local and not system_external'"
language: system
types: [python]
pass_filenames: false
always_run: true
stages: [pre-push]
# pytest - System tests with locally runnable external services
- id: pytest-system-local
name: pytest system_local tests
entry: bash -c "uv run pytest -m system_local --no-cov"
language: system
types: [python]
pass_filenames: false
always_run: true
stages: [pre-push]
# Container Structure Test (runs on pre-push)
- id: container-structure-test
name: container structure test
entry: bash scripts/run-container-structure-test.sh
language: system
pass_filenames: false
always_run: true
stages: [pre-push]