Skip to content

Instantly share code, notes, and snippets.

@aibobrov
Created September 21, 2018 15:02
Show Gist options
  • Save aibobrov/1c8370cc1068f25fefc89c20319f6f7e to your computer and use it in GitHub Desktop.
Save aibobrov/1c8370cc1068f25fefc89c20319f6f7e to your computer and use it in GitHub Desktop.
Build script for Xcode to add TODO, FIXME, ERROR highlighting
TAGS="TODO:|FIXME:"
ERRORTAG="ERROR:"
OUTPUT=$(find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$|($ERRORTAG).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/" | perl -p -e "s/($ERRORTAG)/ error: \$1/")
ECHO "$OUTPUT"
if [[ $OUTPUT == *" error: "* ]]
then
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment