禁用 Eclipse Remote Systems Explorer 的 Sonarlint 自动扫描
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39795619/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Disable Sonarlint automatic scan for Eclipse Remote Systems Explorer
提问by Mark Boessenkool
How can I disable the SonarLint automatic scan in Eclipse for the Remote Systems Explorer plugin?
如何在 Eclipse 中为 Remote Systems Explorer 插件禁用 SonarLint 自动扫描?
Background:
背景:
I recently installed the SonarLint plugin for Eclipse, because a client I work for uses Sonar for code quality. And love the direct reporting of bugs and code smells.
我最近为 Eclipse 安装了 SonarLint 插件,因对我来说有效的一个客户端使用 Sonar 来保证代码质量。并且喜欢直接报告错误和代码异味。
Now I try to do some work for another client, which doesn't use Sonar, and has a old legacy project. Which I have connect to via SFTP so I use the Remote Systems Explorer for that. But when I open any file I can see notices all over the place.
现在我尝试为另一个客户做一些工作,该客户不使用声纳,并且有一个旧的遗留项目。我通过 SFTP 连接到它,所以我使用远程系统资源管理器。但是当我打开任何文件时,我可以看到到处都是通知。
To keep every clean and separated I have setup different workspaces for each client.
为了保持每一个干净和分开,我为每个客户设置了不同的工作区。
Things I tried:
我尝试过的事情:
There is the project settings there is a switch to disable the automatic scan, however those settings are not accessible for the Remote Systems Explorer.
有项目设置,有一个开关可以禁用自动扫描,但是远程系统资源管理器无法访问这些设置。
Also that switch for automatic scan does not seem to be available in the global settings.
此外,自动扫描的开关似乎在全局设置中不可用。
Next to that I tried the following globally SonarLint -> Analyzer Properties as stated in Exclude JS files from SonarLint:
接下来,我尝试了以下全局 SonarLint -> 分析器属性,如从 SonarLint中排除 JS 文件中所述:
sonar.exclusions=**/*.php
sonar.test.exclusions=**/*.php
That did not work, but that could be due to the fact that those settings are not possible in that location. At least that is what is stated in: https://groups.google.com/forum/#!msg/sonarlint/aBxnpn-yLbg/KL9nOiFQBAAJ
这不起作用,但这可能是因为在该位置无法进行这些设置。至少这是在:https: //groups.google.com/forum/#!msg/sonarlint/aBxnpn-yLbg/KL9nOiFQBAAJ
The SonarLint plugin also does not seem to show in the General -> Startup and Shutdown global settings, so I cannot disable it for a specific workspace.
SonarLint 插件似乎也没有显示在 General -> Startup and Shutdown 全局设置中,因此我无法为特定工作区禁用它。
采纳答案by Mark Boessenkool
Ok I seem to have fixed my situation on my own...
好吧,我似乎已经自己解决了我的情况......
As it turns out the exclusions parameters did work, however if SonarLint already has made it's analyses it caches the results somewhere. When opening an already scanned file it shows the results from the previous analyses. To remove that just select all in the Sonarlint window, right mouse click and choose the delete option.
事实证明排除参数确实有效,但是如果 SonarLint 已经进行了分析,它会将结果缓存在某处。打开已扫描的文件时,它会显示先前分析的结果。要删除它,只需在 Sonarlint 窗口中全选,右键单击并选择删除选项。
Edit
编辑
One addition, it seems like if you close Eclipse with open files, and startup Eclipse again, the Sonarlint will automatic check those open files regardless of the exclusions.
另外,如果您关闭带有打开文件的 Eclipse,然后再次启动 Eclipse,Sonarlint 将自动检查那些打开的文件,而不管排除项如何。
回答by Anuraj
Step 1 : Close all opened files in eclipse editor window.
第 1 步:关闭 eclipse 编辑器窗口中所有打开的文件。
Step 2 : Go To Project > Properties > SonarLint , then uncheck 'Run SonarLint Automatically' checkbox.
第 2 步:转到 Project > Properties > SonarLint ,然后取消选中“自动运行 SonarLint”复选框。
Step 3 : Restart Eclipse.
第 3 步:重新启动 Eclipse。