-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
143 lines (135 loc) · 4.43 KB
/
.pre-commit-config.yaml
File metadata and controls
143 lines (135 loc) · 4.43 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
repos:
# Import boundary check: prevent core -> plugins.* imports
- repo: local
hooks:
- id: check-import-boundaries
name: check import boundaries (core must not import plugins)
entry: python3 scripts/check_import_boundaries.py
language: system
pass_filenames: false
files: ^ccproxy/
# Ruff linting and formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.8
hooks:
# Ruff linting (matches: make lint -> uv run ruff check .)
- id: ruff
name: ruff lint
args: [--fix]
types_or: [python, pyi]
# Ruff formatting (matches: make format-check -> uv run ruff format --check .)
- id: ruff-format
name: ruff format
types_or: [python, pyi]
# MyPy type checking (matches: make typecheck -> uv run mypy .)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.17.1
hooks:
- id: mypy
name: mypy type check
additional_dependencies:
# Type stubs
# - types-toml
# - types-PyYAML
- types-aiofiles>=24.0.0
- types-PyYAML>=6.0.12.12
# Core dependencies
- pydantic>=2.8.0
- pydantic-settings>=2.4.0
- fastapi[standard]>=0.115.14
- anthropic>=0.57.1
- openai>=1.93.0
- httpx>=0.28.1
- rich>=13.0.0
- typer>=0.16.0
- uvicorn>=0.34.0
- check-jsonschema>=0.33.2
- aiohttp>=3.12.0
- aiofiles>=24.1.0
# Test dependencies
- pytest>=7.0.0
- pytest-asyncio>=0.23.0
- pytest-cov>=4.0.0
- pytest-env>=0.8.0
- pytest-httpx>=0.21.0
# Metrics dependencies
- prometheus_client>=0.20.0
- duckdb>=1.1.3
- structlog>=24.1.0
# Claude SDK (from git source)
- claude-agent-sdk>=0.0.14
- keyring>=24.0.0
- aiosqlite>=0.21.0
- sqlmodel>=0.0.24
- duckdb-engine>=0.17.0
- tomli>=2.0.0
- fastapi-mcp>=0.1.0
- sse-starlette>=1.0.0
- textual>=3.7.1
- pyjwt>=2.10.0
- sortedcontainers>=2.4.0
args: [--config-file=pyproject.toml]
exclude: ^(docs/|examples/|scripts/)
# Biome for TypeScript/JavaScript (dashboard)
# - repo: local
# hooks:
# - id: biome-format-dashboard
# name: biome format dashboard
# entry: bash -c 'cd dashboard && bun run format'
# language: system
# files: ^dashboard/
# pass_filenames: false
# always_run: true
# - id: biome-lint-dashboard
# name: biome lint dashboard (warnings only)
# entry: bash -c 'cd dashboard && bun run lint || echo "Linting completed with warnings"'
# language: system
# files: ^dashboard/
# pass_filenames: false
# always_run: true
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
# Basic file checks
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-yaml
exclude: ^mkdocs\.yml$ # MkDocs uses custom YAML tags like !ENV
- id: check-toml
- id: check-json
- id: check-merge-conflict
- id: check-added-large-files
args: [--maxkb=1000]
- id: check-case-conflict
# Python-specific checks
- id: check-ast
- id: check-docstring-first
- id: debug-statements
- id: name-tests-test
args: [--pytest-test-first]
exclude: ^tests/(fixtures|factories|helpers|mock)/
# Security checks
# - repo: https://github.com/PyCQA/bandit
# rev: 1.7.10
# hooks:
# - id: bandit
# name: bandit security check
# args: [-c, pyproject.toml]
# additional_dependencies: ["bandit[toml]"]
# Configuration
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
# Note: Tests are intentionally not run in pre-commit hooks as they can be slow
# Run tests manually with: make test or make ci
# The CI pipeline will run the full test suite including:
# - uv run pytest -v --cov=ccproxy --cov-report=xml --cov-report=term-missing