一.安装:
brew tap oclint/formulae
brew install oclint
gem install xcpretty
二.更新:
brew upgrade oclint
三.使用:
workspace=aaa.xcworkspace
target=bb
xcodebuild -workspace $workspace -scheme $target clean&&
xcodebuild -workspace $workspace -scheme $target analyze \
-configuration Debug \
COMPILER_INDEX_STORE_ENABLE=NO \
| xcpretty -r json-compilation-database -o compile_commands.json&&
oclint-json-compilation-database -e Pods -- \
-report-type html -o oclint_result.html \
-rule UnusedLocalVariable \
-max-priority-1=100000 \
-max-priority-2=100000 \
-max-priority-3=100000; \
rm compile_commands.json;
三.参考:
2.OClint学习笔记:
https://blog.csdn.net/hdwhappy/article/details/60767412
3.OCLint代码扫描工具详解:
https://www.jianshu.com/p/5eb91c7348b1
4.官网文档:
http://docs.oclint.org/en/stable/index.html
5.扫描规则size解释:
https://blog.csdn.net/liqinghuiyx/article/details/52437772
6.添加例外:
https://oclint-docs.readthedocs.io/en/stable/howto/suppress.html
7.规则列表:
https://oclint-docs.readthedocs.io/en/stable/rules/index.html
8.规则自定义及调试:
https://blog.csdn.net/hdwhappy/article/details/61924772
四.其他工具:
1.Infer bug types
https://infer.liaohuqiu.net/docs/infer-bug-types.html