Last active
March 8, 2021 20:38
-
-
Save juliabirkett/0daeaafd4eab37be7b8bebb3f1d2a8a8 to your computer and use it in GitHub Desktop.
Pre-commit hook to find FIXME comments
This file contains 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 | |
diff=$(git diff --cached --name-only -G"//[ ]*(FIXME|DONEXT)") | |
FOUND="${FOUND}${diff}" | |
if [ "${FOUND}" != "" ]; then | |
YELLOW='\033[1;33m' | |
echo "=========== WARNING ==============" | |
echo "Found FIXME/DONEXT comments in following file(s). Please address them before commiting." | |
echo | |
echo -e "${YELLOW}- ${FOUND}" | sed 's/^/ /' | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment