-
-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
62 lines (56 loc) · 1.56 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
62 lines (56 loc) · 1.56 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
# Pre-commit hooks for mc_repeater
# Install: pip install pre-commit
# Setup: pre-commit install
# Run manually: pre-commit run --all-files
default_language_version:
python: python3
repos:
# Python-focused safety checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
- id: check-ast
files: ^.*\.py$
- id: debug-statements
files: ^.*\.py$
- id: check-docstring-first
files: ^.*\.py$
- id: check-builtin-literals
files: ^.*\.py$
# Modern Python linting + import sorting + formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.14
hooks:
- id: ruff-check
args: ["--fix"]
files: ^.*\.py$
- id: ruff-format
args: ["--check"]
files: ^.*\.py$
# Security-focused static analysis
- repo: https://github.com/PyCQA/bandit
rev: 1.7.9
hooks:
- id: bandit
args: ["-q", "-l", "-i"]
files: ^.*\.py$
exclude: ^tests/
# Test suite gate
- repo: local
hooks:
- id: openapi-contract-check
name: OpenAPI contract check
entry: python scripts/check_openapi_contract.py
language: python
additional_dependencies: [PyYAML]
pass_filenames: false
always_run: true
files: ^(repeater/web/.*\.py|repeater/web/openapi\.yaml)$
- id: pytest
name: pytest
entry: ./scripts/precommit-pytest.sh
language: system
pass_filenames: false
always_run: true
types: [python]