Skip to content

Instantly share code, notes, and snippets.

@scottcarter
Last active June 17, 2017 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottcarter/cdd2f0b4c7412b1924038a7043340d5a to your computer and use it in GitHub Desktop.
Save scottcarter/cdd2f0b4c7412b1924038a7043340d5a to your computer and use it in GitHub Desktop.
Swift Issue generation Build Phase Run Script
# Copied and modified from:
# https://littlebitesofcocoa.com/207-annotating-swift-with-marks-todo-s-and-fixme-s
#
# Modification is to require a comment to immediately preceed the keyword, so that the keyword can be used elsewhere in code.
#
KEYWORDS="INFO|TODO|FIXME|\?\?\?:|\!\!\!:"
find "${SRCROOT}" \( -name "*.swift" \) -print0 | \
xargs -0 egrep --with-filename --line-number --only-matching "//\s*($KEYWORDS).*\$" | \
perl -p -e "s/\/\/\s*($KEYWORDS)/ warning: \$1/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment