-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
38 lines (36 loc) · 1.33 KB
/
.pre-commit-config.yaml
File metadata and controls
38 lines (36 loc) · 1.33 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
repos:
# General file quality checks (Python source files only)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
files: ^(src|tests|wrapper)/
types: [python]
- id: end-of-file-fixer
files: ^(src|tests|wrapper)/
types: [python]
- id: check-added-large-files
args: [--maxkb=1000]
- id: check-merge-conflict
# Python formatting and linting (src/, tests/, and wrapper/ Python files)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.4
hooks:
# Run the formatter
- id: ruff-format
files: ^(src|tests|wrapper)/
# Run the linter (auto-fix but don't block commits)
- id: ruff
files: ^(src|tests|wrapper)/
args: [--fix, --exit-zero]
# C++ formatting (corelib/ and wrapper/ only)
# Runs clang-format only on files staged for commit, so the codebase
# drifts gradually toward the .clang-format standard rather than
# requiring a blanket one-time reformatting pass.
# NOTE: do NOT run 'pre-commit run --all-files' for C++ — use per-file
# formatting instead to preserve the drift-based approach.
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v22.1.3
hooks:
- id: clang-format
files: ^(corelib|wrapper)/.*\.(cpp|h|hpp)$