Last active
July 27, 2022 09:36
-
-
Save guilhermearaujo/a6e4dbb982fea40a0513 to your computer and use it in GitHub Desktop.
Revisions
-
guilhermearaujo revised this gist
Apr 11, 2015 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,17 @@ source ~/.bash_profile export PATH=$PATH:/usr/local/bin/ if [ -z "${SCHEME+x}" ] then export SCHEME="${PROJECT_NAME}" fi if [ -z "${WORKSPACE+x}" ] then export WORKSPACE="${PROJECT_NAME}.xcworkspace" fi cd "${SOURCE_ROOT}" # Check if xctool and oclint are installed if ! which -s xctool @@ -28,11 +28,11 @@ fi # Cleanup before building rm -f compile_commands.json xctool -workspace "${WORKSPACE}" -scheme "${SCHEME}" clean > /dev/null # Build and analyze # OCLint Rule Index: http://docs.oclint.org/en/dev/rules/index.html xctool -workspace "${WORKSPACE}" -scheme "${SCHEME}" -reporter json-compilation-database:compile_commands.json build oclint-json-compilation-database -e Pods -- -max-priority-1=100000 -max-priority-2=100000 -max-priority-3=100000 \ -disable-rule=InvertedLogic \ -disable-rule=UnusedMethodParameter \ -
guilhermearaujo created this gist
Mar 12, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ # OCLint integration with Xcode ## 1. Integration * Add a new ***Target*** of kind ***Aggregate***, name it ***OCLint*** * Under *Builde Phases*, add a new ***Run Script Phase*** * Paste the script ## 2. Usage * Select target ***OCLint*** * Build the target (press <kbd>⌘</kbd>+<kbd>B</kbd>) * Wait for the script to run * Warnings will appear in the *Issue Navigator* (press <kbd>⌘</kbd>+<kbd>4</kbd>) ## 3. Customization * Rules can be ignored by adding the parameter `-disable-rule=<RuleName>` to the `oclint-json-compilation-database` command * A comprehensive list of rules can be found at [OCLint documentation](http://docs.oclint.org/en/dev/rules/index.html) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ source ~/.bash_profile export PATH=$PATH:/usr/local/bin/ if [ -z ${SCHEME+x} ] then export SCHEME=${PROJECT_NAME} fi if [ -z ${WORKSPACE+x} ] then export WORKSPACE=${PROJECT_NAME}.xcworkspace fi cd ${SOURCE_ROOT} # Check if xctool and oclint are installed if ! which -s xctool then echo 'error: xctool not found, install e.g. with homebrew' exit 1 fi if ! which -s oclint-json-compilation-database then echo 'error: OCLint not installed, install e.g. with homebrew cask' exit 2 fi # Cleanup before building rm -f compile_commands.json xctool -workspace ${WORKSPACE} -scheme ${SCHEME} clean > /dev/null # Build and analyze # OCLint Rule Index: http://docs.oclint.org/en/dev/rules/index.html xctool -workspace ${WORKSPACE} -scheme ${SCHEME} -reporter json-compilation-database:compile_commands.json build oclint-json-compilation-database -e Pods -- -max-priority-1=100000 -max-priority-2=100000 -max-priority-3=100000 \ -disable-rule=InvertedLogic \ -disable-rule=UnusedMethodParameter \ -disable-rule=LongLine \ -disable-rule=LongVariableName \ -disable-rule=ShortVariableName \ -disable-rule=UselessParentheses \ -disable-rule=IvarAssignmentOutsideAccessorsOrInit | sed 's/\(.*\.\m\{1,2\}:[0-9]*:[0-9]*:\)/\1 warning:/' # Final cleanup rm -f compile_commands.json