java - SonarLint 在 VSCode 上缺少 Java 规则

标签 java visual-studio-code sonarqube sonarlint linter

我已经安装了SonarLint , SonarQube support for Visual Studio Code ,还有Sonarqube .

这是我的 global.json

{
    "$schema": "https://raw.githubusercontent.com/silverbulleters/sonarqube-inject-vsc/master/schemas/global.json",
    "servers": [
        {
            "id": "localhost",
            "url": "http://localhost:9000/",
            "token": "28636f8b1a718c765b827d32bcafb7df3e44930b"
        }
    ]
}

这是我本地的 sonarlint.json

{
    "$schema": "https://raw.githubusercontent.com/silverbulleters/sonarqube-inject-vsc/master/schemas/sonarlint.json",
    "serverId": "localhost",
    "projectKey": "springmvc"
}

这是我的环境设置:

  1. sonarqube-7.8。
  2. Java 版本“1.8.0_201”。
  3. VSCode 版本 1.41.1。
  4. JAVA_HOME 和 JRE_HOME 已设置。

更新到 SonarQube 服务器的绑定(bind)运行良好。

a

更新所有绑定(bind)到 SonarQube/SonarCloud 也可以完美运行。 enter image description here

我的问题是:

SonarLint 侧边栏缺少 Java 规则

enter image description here

  1. 如何在那里启用 Java 规则?

  2. VSCode 可以与 SonarQube Server 一起执行哪些任务?

  3. 完成所有安装和配置后,我发现没有任何反应?

Linter 不起作用

enter image description here

对此的任何帮助都非常感谢。

最佳答案

您好,已经从论坛得到答案,表示尚不支持 Java。

“SonarLint for VSCode 暂时不支持 Java 项目。您可以开箱即用地分析 PHP、Python、JS、TS、HTML,以及连接模式下的更多语言(Apex、PL/SQL、 ...)但不是 Java。 我们已经开始与 VSCode Java 开发人员进行一些合作,以便可能解锁此功能,敬请期待。”

参见: https://jira.sonarsource.com/browse/SLVSCODE-35

答案来源:https://community.sonarsource.com/t/the-linter-for-java-rule-doesnt-exist-on-vscode/18383/2

关于java - SonarLint 在 VSCode 上缺少 Java 规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59623508/

相关文章:

android - Sonar Jacoco for Kotlin Setup 不生成代码覆盖率

java - 超时后如何重新建立 JDBC 连接?

java - 将单选按钮绑定(bind)到 Spring Webflow 中的特定枚举值

java - 如何使用 charAt() 函数分割字符串?

jenkins - 调用 'gradle sonarRunner' 时获取 Jenkins 中 Sonar 仪表板的链接

sonarqube - Sonarqube 的 CPD 是什么?

java - 创建回显服务器 : Connected client gets IO-exception

visual-studio-code - Visual Studio代码通知询问我是否要排除Java项目设置文件

node.js - 激活扩展 `ms-vscode.wordcount` 失败 : Cannot find module 'd:/VSCode/vscode-wordcount/out/extension'

java - 如何使用 vscode 将外部 jar 导入到我的项目中?