Skip to content

Commit 4faedfe

Browse files
committed
add debug check to pre-commit
1 parent 0bcbceb commit 4faedfe

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ repos:
1212

1313
- repo: local
1414
hooks:
15+
- id: debug-check
16+
name: Check for debug statements
17+
entry: tests/check-debug.sh
18+
language: script
19+
types: [python]
1520
- id: lint-python
1621
name: Lint Python
1722
entry: make lint-python

tests/check-debug.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
# check for devtools debug commands in a python file
3+
set -e
4+
5+
echo "checking: $1"
6+
7+
if grep -Rn "^ *debug(" "$1"; then
8+
echo "ERROR: debug commands found in $1"
9+
exit 1
10+
fi

0 commit comments

Comments
 (0)