Skip to content

Instantly share code, notes, and snippets.

@tylermilner
tylermilner / oclint.sh
Last active March 12, 2019 19:00 — forked from ryuichis/gist:755e6297aec13c900cdf
Script integrating OCLint into Xcode 10. Put it in "Run script" build phase of aggregate target (see http://docs.oclint.org/en/stable/guide/xcode.html). Replace "<project_name>" and tweak "exclude" flags as necessary.
source ~/.bash_profile
unset LLVM_TARGET_TRIPLE_SUFFIX
xcodebuild -scheme <project_name> -workspace <project_name>.xcworkspace clean
xcodebuild -scheme <project_name> -workspace <project_name>.xcworkspace COMPILER_INDEX_STORE_ENABLE=NO | xcpretty -r json-compilation-database --output compile_commands.json
maxPriority=15000
oclint-json-compilation-database -exclude Pods -exclude build -- -report-type xcode -max-priority-1=$maxPriority -max-priority-2=$maxPriority -max-priority-3=$maxPriority