DevJuice Adding warnings for TODO and FIXME comments

A clever post from deallocatedobjects cropped up on IRC on Friday, and I thought I’d share its wisdom. The post discusses how you can add a custom build phase to automatically show TODO and FIXME comments as warnings in your Xcode 4 (and later) projects.

It takes very little work. Select a target and choose Editor > Add Build Phase > Add Run Script Build Phase. Paste the following bash script in:

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/”

According to the write-up, credit goes to “Tim” on the Cocos2D forums.

Thanks, swillits

DevJuice: Adding warnings for TODO and FIXME comments originally appeared on TUAW – The Unofficial Apple Weblog on Sat, 27 Jul 2013 12:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

You can follow on Twitter or join our Facebook page to keep yourself updated on all the latest from Apple and the Web.