安装
brew tap oclint/formulae
brew install oclint
sudo gem install xcpretty
流程:
xcodebuild -scheme scheme -workspace xcworkspace clean && xcodebuild -workspace xcworkspace -scheme shceme -configuration Debug -sdk iphoneos |xcpretty -r json-compilation-database -o compile_commands.json
单文件:oclint -report-type html -o out.html xx.m
(如果报错:Compile command not found.需要在目录中先编译生成compile_commands.json)
oclint-json-compilation-database -e Pods -v oclint_args "-disable-rule=UnusedMethodParameter -disable-rule=LongLine -disable-rule=LongMethod -disable-rule=NcssMethodCount -disable-rule=MissingBreakInSwitchStatement -rc LONG_VARIABLE_NAME=1200" -- -report-type html -o report.html - max-priority-1=9999 -max-priority-2=9999 -max-priority-3=9999