-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
60 lines (54 loc) · 1.65 KB
/
.pre-commit-config.yaml
File metadata and controls
60 lines (54 loc) · 1.65 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
default_language_version:
python: python3.9 # Match project minimum
fail_fast: true
repos:
# Standard checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
files: ^(tests/|.*\.py|.*\.md|.*\.sh)$
- id: end-of-file-fixer
files: ^(tests/|.*\.py|.*\.md|.*\.sh)$
- id: check-yaml
- id: check-added-large-files
- id: check-merge-conflict
# Shell script linting (preserved from original)
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
files: ^(.*\.sh$|cc-notifier$)
args: [--severity=info, --enable=all]
# Ruff - Primary Python linter and formatter
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
hooks:
- id: ruff-check
args: [--fix]
name: "🔍 Ruff linting with fixes"
- id: ruff-format
name: "✨ Ruff formatting"
# Type checking with MyPy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.0
hooks:
- id: mypy
args: [--strict, --ignore-missing-imports]
files: ^.*\.py$
# Security scanning
- repo: https://github.com/PyCQA/bandit
rev: 1.8.0
hooks:
- id: bandit
args: [-r, .]
exclude: tests/
# Fast test subset (when tests exist)
- repo: local
hooks:
- id: pytest-fast
name: "🧪 Fast tests"
entry: bash -c 'if [ -n "$(find tests -name "*.py" 2>/dev/null)" ]; then pytest -x -q --tb=short tests/; else echo "No tests found, skipping"; fi'
language: system
pass_filenames: false
stages: [commit]