Skip to content

Commit 0a1c9ea

Browse files
authored
add pre-commit hooks for mypy semgrep and trufflehog (#219)
1 parent 031cdc5 commit 0a1c9ea

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.pre-commit-config.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
fail_fast: false
12
repos:
23
- repo: https://github.com/psf/black
34
# Make sure to update requirements-dev-extra.txt to match versions!
@@ -49,3 +50,30 @@ repos:
4950
language: python
5051
- id: check-toml
5152
language: python
53+
- repo: https://github.com/pre-commit/mirrors-mypy
54+
rev: 'v1.3.0' # Make sure this matches the version in requirements-dev.txt!
55+
hooks:
56+
- id: mypy
57+
name: mypy-clients-python
58+
entry: mypy --config-file clients/python/mypy.ini clients/python
59+
language: system
60+
- repo: https://github.com/pre-commit/mirrors-mypy
61+
rev: 'v1.3.0' # Make sure this matches the version in requirements-dev.txt!
62+
hooks:
63+
- id: mypy
64+
name: mypy-server
65+
entry: mypy --config-file model-engine/mypy.ini model-engine
66+
language: system
67+
- repo: local
68+
hooks:
69+
- id: trufflehog
70+
name: TruffleHog
71+
description: Detect secrets in your data.
72+
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'
73+
language: system
74+
stages: ["commit", "push"]
75+
- repo: https://github.com/returntocorp/semgrep
76+
rev: 'v1.36.0'
77+
hooks:
78+
- id: semgrep
79+
args: [ '--config', 'p/python', '--error' ]

0 commit comments

Comments
 (0)