-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
72 lines (65 loc) · 2.45 KB
/
.pre-commit-config.yaml
File metadata and controls
72 lines (65 loc) · 2.45 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: ^(src/inference_endpoint/openai/openai_types_gen.py|src/inference_endpoint/openai/openapi.yaml)$
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
exclude: ^(src/inference_endpoint/openai/openai_types_gen.py|src/inference_endpoint/openai/openapi.yaml|docs/res/.*)$
- id: check-merge-conflict
- id: debug-statements
# TODO: sync rev with ruff version in pyproject.toml (currently 0.15.8)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.3
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
hooks:
- id: mypy
args: [--config-file=./pyproject.toml, src, tests]
pass_filenames: false
verbose: true
additional_dependencies:
- types-PyYAML==6.0.12
- types-requests>=2.32.4
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
types_or: [yaml, json, markdown]
exclude: ^(src/inference_endpoint/openai/openai_types_gen.py|src/inference_endpoint/openai/openapi.yaml)$
- repo: local
hooks:
- id: pytest-check
name: pytest
entry: pytest
language: system
pass_filenames: false
always_run: true
args: ["--tb=short", "--strict-markers"]
stages: [manual]
- id: validate-templates
name: Validate YAML templates against schema
entry: python -c "from pathlib import Path; from inference_endpoint.config.schema import BenchmarkConfig; [BenchmarkConfig.from_yaml_file(f) for f in sorted(Path('src/inference_endpoint/config/templates').glob('*.yaml'))]"
language: system
pass_filenames: false
files: ^src/inference_endpoint/config/(schema\.py|templates/)
- id: add-license-header
name: Add license headers
entry: python scripts/add_license_header.py
language: system
types: [python]
pass_filenames: true
exclude: ^(src/inference_endpoint/openai/openai_types_gen.py)$
- id: uv-lock-check
name: Check uv.lock is up-to-date
entry: uv lock --check
language: python
additional_dependencies: [uv]
pass_filenames: false
files: ^pyproject\.toml$