Created
January 9, 2015 17:43
-
-
Save cmyr/1c1c6fe52d6fa57034a0 to your computer and use it in GitHub Desktop.
Compiler warnings for FIXME:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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