Skip to content

Instantly share code, notes, and snippets.

@funky-monkey
Last active January 27, 2017 18:07
Show Gist options
  • Save funky-monkey/7d006abc5ad0ec8d71f3 to your computer and use it in GitHub Desktop.
Save funky-monkey/7d006abc5ad0ec8d71f3 to your computer and use it in GitHub Desktop.
Generate Xcode warnings from TODO's and FIXME's for Swift
#!/bin/bash
# Search all TODO, FIXME, ???, !!! and XXX from .swift files
# To install in Xcode and 'Build Phase' and add 'New Run Script Phase'
KEYWORDS="TODO:|FIXME:|\?\?\?:|\!\!\!:XXX:"
find "${SRCROOT}" \( -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment