1

我正在尝试从命令行获取警告、错误、语法编码约定和圈复杂度的列表。我发现 oclint 可以用于我的目的。但后来我遇到了一个问题

我试图做的。

xcodebuild -project testing.xcodeproj -target "testing" -configuration "Debug" -destination "platform=iOS Simulator,name=iPad" -sdk "iphonesimulator7.0" -IDEBuildOperationMaxNumberOfConcurrentCompileTasks=8 clean
xcodebuild -project testing.xcodeproj -target "testing" -configuration "Debug" -destination "platform=iOS Simulator,name=iPad" -sdk "iphonesimulator7.0" -IDEBuildOperationMaxNumberOfConcurrentCompileTasks=8 build |tee xcodebuild.log

oclint-xcodebuild xcodebuild.log

到这里一切都很好,甚至 compile_commands.json 也被正确创建。

但是当我跑步时,我oclint-json-compilation-database收到了这个错误。

我从这里读到我必须oclint [-enable-clang-static-analyzer]在上述命令成功后使用

如果有人知道如何解决这个问题或对我的要求有更好的解决方案请告诉我

编辑:如果我使用clint [-enable-clang-static-analyzer -R /usr/lib/oclint/rules ]然后我得到错误oclint: error: cannot find dynamic library for report type: text

4

1 回答 1

0

发现了我的问题。发布解决方案,因为它可以帮助一些人。

我的问题是,我克隆了存储库并手动将脚本文件粘贴到了 usr/local/lib 中,但不知何故是不对的!我所做的是删除那些并进行了 brew 安装。

这是命令

brew install https://raw.github.com/ryuichisaito6/homebrew/f12a21dd274899ef9ab14cd97e45f315dd982cf6/Library/Formula/oclint.rb 

谢谢

于 2014-09-11T10:28:22.410 回答