OCLint-iOS-OC项目几种简单使用

OCLint-iOS-OC项目几种简单使用

未完待续

--
OCLint-iOS-OC项目几种简单使用OCLint的部分规则(Basic 部分)
OCLint的部分规则(Unuseed 部分)OCLint的部分规则(Size 部分)
OCLint的部分规则(Redundant 部分)OCLint的部分规则(Naming 部分)
OCLint的部分规则(Migration 部分)OCLint的部分规则(Empty 部分)
OCLint的部分规则(Design 部分)OCLint的部分规则(Convention 部分)
OCLint的部分规则(CoCoa 部分)



OCLint简介

OCLint is a static code analysis tool for improving quality and reducing defects by inspecting C, C++ and Objective-C code and looking for potential problems like possible bugs, unused code, complicated code, redundant code, code smells, bad practices, and so on.

安装

$ brew tap oclint/formulae

$ brew install oclint

Using OCLint with xcodebuild

xcodebuild -target DemoProject -configuration Debug -scheme DemoProject

Using OCLint with xctool

安装

$ brew install xctool –HEAD

xctool -reporter json-compilation-database:compile_commands.json build

Using OCLint with xcpretty

安装

$ brew install xcpretty

xcodebuild [flags] | xcpretty -r json-compilation-database -o compile_commands.json

Using OCLint in Xcode

  • Add a new target in the project, and choose Aggregate as the template.


    图片名称

  • Name the new target, here we simply call it “OCLint”, you could have more than one targets that focus on different aspects of the code analysis.


图片名称

  • Add a new build phase in the target we just created. Choose Add Run Script for the phase type.


图片名称

  • Choose the correct build scheme, here we choose OCLint.Click to build, or use the shortcut Command+B.
  • Click to build, or use the shortcut Command+B.
  • When the progress bar scrolls to the very right, the analysis is done, then we can check out the analysis results same as compile warnings.


图片名称

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值