Skip to content

Instantly share code, notes, and snippets.

@shakemno
Last active September 9, 2019 00:46
Show Gist options
  • Select an option

  • Save shakemno/c66ae6e959fad82300c662120b700326 to your computer and use it in GitHub Desktop.

Select an option

Save shakemno/c66ae6e959fad82300c662120b700326 to your computer and use it in GitHub Desktop.
XCode build phase script to never miss any 'force' Quick or Nimble test
TAGS="TODO:|FIXME:"
ERRORTAG="ERROR:"
HELPERS="fdescribe|fcontext|fit"
VIOLATIONS=$(find "${SRCROOT}" "./SUBDIRA" "./SUBDIRB" \
\( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number \
--only-matching "($TAGS).*\$|($ERRORTAG).*|($HELPERS).*\$" |\
perl -p -e "s/($TAGS)/ warning: \$1/" |\
perl -p -e "s/($ERRORTAG)/ error: \$1/" |\
perl -p -e "s/($HELPERS)/ error: \$1/")
if [ -n "$VIOLATIONS" ];
then
echo "error: $VIOLATIONS"; exit 1
else
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment