Skip to content

Instantly share code, notes, and snippets.

@juliabirkett
Last active March 8, 2021 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juliabirkett/0daeaafd4eab37be7b8bebb3f1d2a8a8 to your computer and use it in GitHub Desktop.
Save juliabirkett/0daeaafd4eab37be7b8bebb3f1d2a8a8 to your computer and use it in GitHub Desktop.
Pre-commit hook to find FIXME comments
#!/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