-
Create the
scripts
folder at./
:mkdir scripts
-
Give it the right permissions for execution:
chmod -R u+x scripts
-
Create
xcode_warnings.sh
file at./scripts/
:-
Moving to
scripts
folder:cd scripts
-
Creating
xcode_warning.sh
file:touch xcode_warnings.sh
-
-
In
xcode_warnings.sh
add the following code:#!/bin/bash TAGS="TODO:|FIXME:|WARNING:" ERRORTAG="ERROR:" OUTPUT=$(find "${SRCROOT}" -name "*.h" -or -name "*.m" -or -name "*.swift" \( -not -path "${SRCROOT}/Carthage/*" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$|($ERRORTAG).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/" | perl -p -e "s/($ERRORTAG)/ error: \$1/") ECHO "$OUTPUT" if [[ $OUTPUT == *" error: "* ]] then exit 1 fi
Created
July 21, 2017 23:14
-
-
Save eMdOS/d6ec6724041b48544b0e3b0666afd63c to your computer and use it in GitHub Desktop.
Xcode: code comments warning (TODO: | FIXME: | WARNING: | ERROR:)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment