Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Compiler warnings for FIXME:
#!/bin/bash
WARNINGTAGS="FIXME:|\?\?\?:"
ERRORTAGS="\!\!\!:"
find "${SRCROOT}" \( -name "*.swift" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($WARNINGTAGS).*\$" | perl -p -e "s/($WARNINGTAGS)/ warning: \$1/"
if [ "${CONFIGURATION}" = "Release" ]
then
find "${SRCROOT}" \( -name "*.swift" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($ERRORTAGS).*\$" | perl -p -e "s/($ERRORTAGS)/ error: \$1/"
else
find "${SRCROOT}" \( -name "*.swift" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($ERRORTAGS).*\$" | perl -p -e "s/($ERRORTAGS)/ warning: \$1/"
fi
@cmyr

This comment has been minimized.

Copy link
Owner Author

commented Jan 9, 2015

This makes 'FIXME:, '???:' and '!!!:' into compiler warnings on build. '!!!:' is a compiler error if building for release.

'TODO:' is ignored in this script, for historical reasons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.