-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
91 lines (83 loc) · 3.06 KB
/
.pre-commit-config.yaml
File metadata and controls
91 lines (83 loc) · 3.06 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
81
82
83
84
85
86
87
88
89
90
91
# Pre-commit hooks configuration - tuned for fast local checks and reliable CI
# See https://pre-commit.com for details
default_language_version:
# Use the `python` executable from the active environment so pre-commit
# can reuse your project's `.venv` if it's activated before installing
# hooks. This avoids duplicating heavy dependencies in the pre-commit
# environment and keeps local dev faster/consistent with CI.
python: python
repos:
# Ruff - fast linter + formatter. We run the fixer first, then the formatter.
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.10
hooks:
- id: ruff
args: [--fix]
types_or: [python, pyi]
- id: ruff-format
types_or: [python, pyi]
# Pyright - static type checker. Keep additional deps minimal here.
# If you need Pyright to resolve many third-party packages, prefer running
# Pyright in CI with the project's venv or add only required items below.
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.407
hooks:
- id: pyright
# Pragmatic set of packages so Pyright inside pre-commit can resolve
# common optional imports used by drivers and tests. CI can run a
# stricter environment using the project's venv if necessary.
additional_dependencies:
- msgpack>=1.0.7
- pytest>=9.0.2
- pytest-asyncio>=1.3.0
- aio-pika>=9.3.1
- asyncpg>=0.29.0
- asyncmy>=0.2.9
- redis>=5.0.1
- aioboto3>=12.0.0
- types-aioboto3[sqs]>=12.0.0
- sqlalchemy>=2.0.22
- django>=5.0
- tortoise-orm>=0.21.0
- uvloop>=0.19.0
- rich>=13.6.0
- pydantic-settings>=2.0.0
# Standard hooks for whitespace, JSON/TOML/YAML checks and basic safety
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-json
- 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]
# Validate pyproject.toml schema. In CI without network, consider adding
# 'validate-pyproject-schema-store[all]' as an additional_dependency here.
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.24.1
hooks:
- id: validate-pyproject
# additional_dependencies: ["validate-pyproject-schema-store[all]"]
# Secrets detection (gitleaks). Use a baseline or CI run to minimize noise.
- repo: https://github.com/gitleaks/gitleaks
rev: v8.30.0
hooks:
- id: gitleaks
args: ["--redact"]
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ""
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: weekly
skip: []
submodules: false