我们如何在 Eclipse 中使用声纳的自定义设置?

How we can use custom settings for sonar in eclipse?

我正在使用 SonarLint 以获得更好的代码。这是使用默认设置。我有一个包含以下条目的 xml 文件。

<profile>
    <name>Sonar Way with Custom rules</name>
    <language>java</language>
    <rules>
    <rule>
    <repositoryKey>common-java</repositoryKey>
    <key>DuplicatedBlocks</key>
    <priority>MINOR</priority>
    </rule>
    <rule>
    <repositoryKey>common-java</repositoryKey>
    <key>InsufficientBranchCoverage</key>
    <priority>MAJOR</priority>
    <parameters>
    <parameter>
    <key>minimumBranchCoverageRatio</key>
    <value>65.0</value>
    </parameter>
    </parameters>
    </rule> 
<profile>

我的问题是如何使用此 xml 作为 SonarLint 的自定义设置。 谢谢

正确的做法是在 SonarQube 服务器中定义一个质量配置文件,其中包含您要激活的规则并将 SonarLint 连接到它。

有关详细信息,请查看您在 http://www.sonarlint.org 中使用的 IDE 的 "Connected mode" 部分。