2014-09-10 31 views
1

我想從命令行得到警告,錯誤,語法編碼約定和圈複雜度的列表。我發現oclint可以用於我的目的。但後來我遇到了問題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

回答

0

發現我的問題。張貼解決方案,因爲它可以幫助一個人。

我的問題是,我克隆了存儲庫並手動將腳本文件粘貼到usr/local/lib中,並且不知何故是不正確的!我所做的是刪除這些,並做了一個brew安裝。

這裏是命令

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

感謝

+0

嘗試0.9,因爲它是bug更少 – 2014-09-12 08:15:02