Skip to content

Instantly share code, notes, and snippets.

@yuliantoeric
Last active March 26, 2018 07:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save yuliantoeric/a4a998d8243cfa9e26cfe5e1ae4b3cf7 to your computer and use it in GitHub Desktop.
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
#!/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