Xcode using FIXME, TODO, ???,?

前端 未结 9 1219
抹茶落季
抹茶落季 2021-01-30 04:13

I have started to use the FIXME, TODO, ??? and !!! tags in XCode but have am finding it painful that it does not recognise th

相关标签:
9条回答
  • 2021-01-30 04:54

    The FIXME:, TODO:, ???: and !!!: works in 4.3.3 inside and outside of functions.

    You can have any number of whitespace before or after the double slash, but you have to use uppercase and follow the tag with a colon.

    Just to make it clear - all of these work:

    //          FIXME: This works.
      //TODO: This works.
        //                  !!!: Working.
    // // //???: Works as well.
    
    0 讨论(0)
  • 2021-01-30 04:58

    Just a heads up, but I've noticed the TODO:'s do not work within blocks of any kind. Just move it right above or below your block.

    0 讨论(0)
  • 2021-01-30 05:01

    This is the script I use as an added build phase, note it excludes files pulled-in via Carthage (very annoying to get these as well otherwise since its not 'your' code) :

    TAGS="WARNING:|TODO:"
    echo "searching ${SRCROOT} for ${TAGS}"
    find "${SRCROOT}" \( -name "*.swift" \) -not -path "${SRCROOT}/Carthage/*" -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/"
    

    Works well on xCode 9.3 with Swift 4

    0 讨论(0)
提交回复
热议问题