Search code examples
eclipsesonarqubesonarlint

How we can use custom settings for sonar in eclipse?


I am using SonarLint for better code. This is using default settings. I have an xml file with following entries.

<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>

My question is how I can use this xml as my custom settings for SonarLint. Thanks


Solution

  • The correct way of doing it is to define a Quality Profile in a SonarQube server with the rules that you want to activate and connect SonarLint to it.

    For more information, check the "Connected mode" section for the IDE you are using in http://www.sonarlint.org.