Generate warning for TODO and FIXME in Xcode with Cocoapods
I was trying to generate a warning in Xcode if there is one in my project TODO:
or FIXME:
using the following bash script from HERE :
TAGS="TODO:|FIXME:"
echo "searching ${SRCROOT} for ${TAGS}"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/"
How I used CocoaPods, is it possible to search only for my project and its testing, but not in Pods?
EDIT: update the sample code for .swift compatibility
TAGS="TODO:|FIXME:"
echo "searching ${SRCROOT} for ${TAGS}"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/"
+3
source to share