Skip to content

Instantly share code, notes, and snippets.

@fguchelaar
Last active September 18, 2016 12:25
Show Gist options
  • Save fguchelaar/acf276e02ea60238ef0d to your computer and use it in GitHub Desktop.
Save fguchelaar/acf276e02ea60238ef0d to your computer and use it in GitHub Desktop.
Generate Xcode warnings from TODO, FIXME and ERROR comments. Modified version of the original one at http://jeffreysambells.com/2013/01/31/generate-xcode-warnings-from-todo-comments
TAGS="TODO:|FIXME:"
ERRORTAG="ERROR:"
OUTPUT=$(find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -print0 | xargs -0 egrep --ignore-case --with-filename --line-number --only-matching "($TAGS).*\$|($ERRORTAG).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/i" | perl -p -e "s/($ERRORTAG)/ error: \$1/i")
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