Skip to content

Instantly share code, notes, and snippets.

@steipete
Created February 15, 2014 15:43
Show Gist options
  • Star 27 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steipete/9021032 to your computer and use it in GitHub Desktop.
Save steipete/9021032 to your computer and use it in GitHub Desktop.
Run Script that converts TODO or FIXME or ??? into a warning. Super useful.
KEYWORDS="TODO:|FIXME:|\?\?\?:|\!\!\!:"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/"
@mmorey
Copy link

mmorey commented Feb 15, 2014

If you are using CocoaPods you could do something like this:

KEYWORDS="TODO|FIXME|\?\?\?:|\!\!\!:"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -and \( -path "${SRCROOT}/Pods/*" -prune -o -print0 \) | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/"

From http://matthewmorey.com/improved-xcode-build-phases/.

Problem is, not all source files in a project are in ${SRCROOT}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment