Skip to content

Instantly share code, notes, and snippets.

@abargh
Last active February 23, 2018 18:11
Show Gist options
  • Save abargh/081947153e3a32de52526b68ebf05cfd to your computer and use it in GitHub Desktop.
Save abargh/081947153e3a32de52526b68ebf05cfd to your computer and use it in GitHub Desktop.
Map TODO: / FIXME: / WARNING: / ERROR: Code Comments to Xcode Compiler Warnings / Errors
# Courtesy of https://medium.com/ios-os-x-development/highlight-warnings-in-xcode-521125121a75
TAGS="TODO:|FIXME:|WARNING:"
ERRORTAG="ERROR:"
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/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment