【问题标题】:oclint: error: no rule loadedoclint:错误:未加载规则
【发布时间】:2014-11-04 00:24:35
【问题描述】:

我正在尝试从命令行获取警告、错误、语法编码约定和圈复杂度的列表。我发现 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 时,我得到了这个错误。

我从here读到上面的命令成功后我必须使用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

【问题讨论】:

    标签: macos static-code-analysis oclint


    【解决方案1】:

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

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

    这是命令

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

    谢谢

    【讨论】:

    • 尝试 0.9,因为它的 bug 更少
    猜你喜欢
    • 2015-06-27
    • 1970-01-01
    • 1970-01-01
    • 2022-07-11
    • 1970-01-01
    • 2012-11-14
    • 1970-01-01
    • 1970-01-01
    • 2010-12-31
    相关资源
    最近更新 更多