-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
80 lines (72 loc) · 1.86 KB
/
.pre-commit-config.yaml
File metadata and controls
80 lines (72 loc) · 1.86 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
# Pre-commit hooks for automatic code quality
# Install: pip install pre-commit && pre-commit install
# Bypass: git commit --no-verify (if needed)
# Run manually: pre-commit run --all-files
repos:
# Markdown linting with auto-fix
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.12.1
hooks:
- id: markdownlint-cli2
args: ['--fix']
files: \.md$
# Python code formatting (black)
- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
files: \.py$
# Python import sorting
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args: ['--profile', 'black']
files: \.py$
# Ruff - Fast Python linter with auto-fix
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.15
hooks:
- id: ruff
args: [--fix]
files: \.py$
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: \.md$ # Markdown sometimes needs trailing spaces
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-added-large-files
args: ['--maxkb=5000']
- id: check-merge-conflict
- id: debug-statements
- id: mixed-line-ending
args: ['--fix=lf']
# Security scanning (runs fast, non-blocking)
- repo: https://github.com/PyCQA/bandit
rev: 1.7.6
hooks:
- id: bandit
args: [-ll, --recursive] # Only report medium+ severity
files: ^src/.*\.py$
exclude: ^(tests/|deprecated/|src/deprecated/)
# Configuration
default_language_version:
python: python3
exclude: |
(?x)(
^\.git/|
^\.cache/|
^\.pytest_cache/|
^__pycache__/|
^venv/|
^env/|
\.egg-info/|
^build/|
^dist/|
^deprecated/|
^src/deprecated/
)