-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
73 lines (67 loc) · 1.76 KB
/
.pre-commit-config.yaml
File metadata and controls
73 lines (67 loc) · 1.76 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
# Pre-commit hooks configuration
# Install: pip install pre-commit && pre-commit install
# Run manually: pre-commit run --all-files
repos:
# Ruff - Fast Python linter and formatter
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.0
hooks:
- id: ruff
args: [--fix]
types_or: [python, pyi]
- id: ruff-format
types_or: [python, pyi]
# Basic file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: ^(docs/|\.md$)
- id: end-of-file-fixer
exclude: ^(docs/|\.md$)
- id: check-yaml
args: [--safe]
- id: check-json
- id: check-toml
- id: check-added-large-files
args: [--maxkb=1000]
- id: check-merge-conflict
- id: check-case-conflict
- id: detect-private-key
- id: mixed-line-ending
args: [--fix=lf]
# Python-specific checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: debug-statements
- id: check-ast
- id: check-builtin-literals
- id: check-docstring-first
# Type checking with mypy (aligned with pyproject.toml)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.0
hooks:
- id: mypy
additional_dependencies: [types-all]
args: [--config-file=pyproject.toml]
exclude: ^(bt_api_py/ctp/|tests/)
# Configuration
default_language_version:
python: python3.11
# Files to exclude
exclude: |
(?x)^(
\.git/|
\.venv/|
venv/|
build/|
dist/|
.*\.egg-info/|
__pycache__/|
.*\.pyc$|
bt_api_py/ctp/ctp\.py\.bak$|
bt_api_py/ctp/ctp_wrap\.*|
bt_api_py/ctp/_ctp.*\.so$|
docs/
)