forked from scaleapi/llm-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
80 lines (80 loc) · 2.57 KB
/
.pre-commit-config.yaml
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
fail_fast: false
repos:
- repo: https://github.com/psf/black
# Make sure to update requirements-dev-extra.txt to match versions!
rev: 24.8.0
hooks:
- id: black
name: "python:black"
entry: black --config .black.toml
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.8
hooks:
- id: ruff
name: "python:ruff"
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: "python:isort"
- repo: https://github.com/jazzband/pip-tools
rev: 7.4.1
hooks:
- id: pip-compile
files: model-engine/requirements\.(in|txt)
args:
[
model-engine/requirements.in,
--allow-unsafe,
--no-emit-index-url,
--no-emit-trusted-host,
--index-url=https://pypi.org/simple,
]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0 # https://github.com/pre-commit/pre-commit-hooks/releases
hooks:
- id: check-added-large-files
args:
- '--maxkb=1024' # no more than 1 MB, which is already quite generous!
- id: check-ast
language: python
- id: check-case-conflict
language: python
- id: check-json
language: python
- id: check-merge-conflict
language: python
- id: check-shebang-scripts-are-executable
language: python
- id: check-symlinks
language: python
- id: check-toml
language: python
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.11.2' # Make sure this matches the version in requirements-dev.txt!
hooks:
- id: mypy
name: mypy-clients-python
files: clients/python/.*
entry: mypy --config-file clients/python/mypy.ini
language: system
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.11.2' # Make sure this matches the version in requirements-dev.txt!
hooks:
- id: mypy
name: mypy-server
entry: mypy --config-file model-engine/mypy.ini
language: system
- repo: local
hooks:
- id: trufflehog
name: TruffleHog
description: Detect secrets in your data.
entry: bash -c 'docker run --rm -v "$(pwd)/..:/workdir" -i --rm trufflesecurity/trufflehog:latest git file:///workdir/llm-engine --since-commit HEAD --only-verified --fail'
language: system
stages: ["commit", "push"]
- repo: https://github.com/returntocorp/semgrep
rev: 'v1.89.0'
hooks:
- id: semgrep
args: [ '--config', 'p/python', '--error' ]