Last active
March 26, 2018 07:24
-
-
Save yuliantoeric/a4a998d8243cfa9e26cfe5e1ae4b3cf7 to your computer and use it in GitHub Desktop.
Xcode run script to generate warning for TODO: and FIXME: tags in swift
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/sh | |
# To install in Xcode, add "New Run Script Phase" to the target "Build Phases" | |
TAGS="TODO:|FIXME:" | |
echo "searching ${SRCROOT} for ${TAGS}" | |
find "${SRCROOT}" \( -name "*.h" -o -name "*.m" -o -name "*.swift" \) -print0 \ | |
| xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" \ | |
| perl -p -e "s/($TAGS)/ warning: \$1/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment