Created
June 22, 2025 12:06
-
-
Save crlane/eea2226cfeb9cd58571dd6072e1e5db7 to your computer and use it in GitHub Desktop.
Precommit Hook to Detect Python Debug Breakpoints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
REGEX="(i?pdb|__import__\((\'|\")i?pdb(\'|\")\)).set_trace\(\)" | |
if git-grep --cached -n -P "$REGEX"; then | |
echo "Your commit includes interactive debug statements. Please remove" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment