Skip to content

Instantly share code, notes, and snippets.

@gtranchedone
Created November 7, 2016 13:01
Show Gist options
  • Save gtranchedone/e3284bc32f7b9cbed6cee0cf07ba2730 to your computer and use it in GitHub Desktop.
Save gtranchedone/e3284bc32f7b9cbed6cee0cf07ba2730 to your computer and use it in GitHub Desktop.
Script to highlight comments marking TODOs, FIXMEs, WARNINGs and ERRORs in Xcode
TAGS="\/\/.*TODO:|\/\/.*FIXME:|\/\/.*WARNING:|\/\/.*ERROR:"
TARGET_FOLDER="${SRCROOT}"
echo "searching ${TARGET_FOLDER} for ${TAGS}"
find -E "${TARGET_FOLDER}" -regex ".*\.(swift|m|h)" ! -path "${PODS_ROOT}/**/*" -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment