-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.pre-commit-config.yaml
34 lines (30 loc) · 991 Bytes
/
.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
repos:
- repo: local
hooks:
- id: run-tests
name: Run Tests
entry: pytest
language: system
types: [python]
pass_filenames: false
- id: remove-traces
name: Remove pdb/ipdb trace statements and run Black
entry: python remove_traces.py
language: python
files: \.py$
- id: check-for-debugger
name: Check for pdb.set_trace and ipdb.set_trace
entry: bash -c 'FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E ".py$"); if [ -n "$FILES" ]; then grep -Hn "pdb.set_trace\|ipdb.set_trace" $FILES && echo "Debugger statement found!" && exit 1; fi; exit 0'
language: system
types: [python]
files: \.py$
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
name: black
entry: black
language: python
types: [python]
args: ["--check"]
additional_dependencies: ["black"]