首页 > 解决方案 > Rider 2019.1 - 从命令行启动代码检查

问题描述

我正在尝试通过引用以下链接使用命令行工具运行 Rider IDE 的代码检查流程:

https://www.jetbrains.com/help/idea/command-line-code-inspector.html

如文档中所述,我找不到任何正确的“检查路径”。

这是命令语法:

IntelliJ\ IDEA.app/Contents/bin/inspect.sh project-path inspection-path output-path -v2 -d subdirectory-path

这是一个示例调用:

IntelliJ\ IDEA.app/Contents/bin/inspect.sh ~/MyProject ~/MyProject/.idea/inspectionProfiles/Project_Default.xml ~/MyProject/inspection-results-dir -v2 -d ~/MyProject/subdirectory

当我打开项目文件夹下的“.idea”文件夹时,没有“inspectionProfiles”文件夹和“Project_Default.xml”文件作为“inspection-path”参数传递。

在我项目的“.idea”文件夹下有

".idea/.idea.game-unity/.idea/codeStyles/codeStyleConfig.xml"

当我运行以下命令时:

./inspect.sh /Users/fcoskun/Projects/gameUnity/game-unity /Users/fcoskun/Projects/gameUnity/game-unity/.idea/.idea.game-unity/.idea/codeStyles/codeStyleConfig.xml /Users/fcoskun/Projects/gameUnity/game-unity -v2 -d /Users/fcoskun/Projects/gameUnity/game-unity/Assets/Scripts

我得到这个结果:

2019-07-02 12:54:34.925 rider[22432:35398688] allVms required 1.8*,1.8+
2019-07-02 12:54:34.928 rider[22432:35398694] Value of RIDER_VM_OPTIONS is (null)
2019-07-02 12:54:34.928 rider[22432:35398694] fullFileName is: /Applications/Rider.app/Contents/bin/rider.vmoptions
2019-07-02 12:54:34.928 rider[22432:35398694] fullFileName exists: /Applications/Rider.app/Contents/bin/rider.vmoptions
2019-07-02 12:54:34.928 rider[22432:35398694] Processing VMOptions file at /Applications/Rider.app/Contents/bin/rider.vmoptions
2019-07-02 12:54:34.929 rider[22432:35398694] Done



Installation home directory: file:////Applications/Rider.app/Contents
System directory: file:////Users/fcoskun/Library/Caches/Rider2019.1
Config directory: file:////Users/fcoskun/Library/Preferences/Rider2019.1
Log directory: file:////Users/fcoskun/Library/Logs/Rider2019.1

Following output will be written to a log file /Users/fcoskun/Library/Logs/Rider2019.1/frontend.log

在 frontend.log 文件中,有一个关于 InspectionApplication 的 NullPointerException :

12:54:42.572 | ERROR | InspectionApplication          | null
java.lang.NullPointerException
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:430)
    at com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1682)
    at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1631)
    at com.jetbrains.rider.projectView.SolutionManager.openDirectoryInteractive(SolutionManager.kt:141)
    at com.jetbrains.rider.projectView.SolutionManager.openDirectoryInteractive$default(SolutionManager.kt:131)
    at com.jetbrains.rider.projectView.ideaInterop.RiderProjectOpenProcessor.a(RiderProjectOpenProcessor.kt:44)
    at com.jetbrains.rider.projectView.ideaInterop.RiderProjectOpenProcessor.doOpenProject(RiderProjectOpenProcessor.kt:37)
....
....

有没有人可以帮助我解决这个问题?我应该如何调用该 inspect.sh 脚本?

标签: unity3dridercode-inspection

解决方案



推荐阅读