Is it possible to have SonarLint for IntelliJ IDEA enforce only the rules I have enabled on my Sonar server?
-
Welcome on Stack overflow:) Please familiraize yourself with how to ask a good question – DawidPi Oct 16 '15 at 17:28
4 Answers
As it is now possible with the current release of SonarLint (I'm using version 3.0.0.2041), people might be interested in the solution.
File -> Settings -> Other Settings -> SonarLint General Settings
- Click on the green + in "SonarQube servers" :
- Enter a name (ex : SonarQube / localhost)
- Select SonarQube and enter URL like
http://localhost:9000
- Authentication : select your user token or your login/pwd
- Click on Finish
- Click on "Update binding" to synchronize with the SonarQube server
- Go to
SonarLint Project Settings
and bind your project to the SonarQube project
Thus, when you open your files, SonarLint will automatically retrieve the SonarQube server's issues.

- 2,150
- 2
- 19
- 33
SonarLint 1.0 for Eclipse and IntelliJ do not allow to edit the quality profile (or set of rules) to be used for the analysis. Moreover, SonarLint 1.x works completely independently of a SonarQube server (having a SonarQube server is not a requirement), and therefore does not have the ability to reuse a quality profile defined there.
SonarLint 2.0 will have an optional mode that connects to a SonarQube server, and will offer this feature - but this isn't available yet.

- 2,971
- 1
- 17
- 20
-
6
-
2We're working on this, this should be available in about a month. – Fabrice - SonarSource Team Mar 15 '16 at 08:13
-
2SonarLint v2.0 for IntelliJ is out now, and has this "connect to sonar server" feature, but even so, it seems it isn't in sync with server rules. Does it work for other people? – shoguren Apr 22 '16 at 21:45
-
2I've tried it but I can't use my custom rules from quality profile through sonarlint. – Ricardo García Apr 27 '16 at 12:54
For Android Studio Chipmunk , Dolphin 2022, Bumblebee and Arctic Fox
File >> Settings >> Tools >> SonarLint >> Rules
Then select your project language and any rule then check/uncheck it, you can edit its options (if exist)

- 668
- 9
- 19
These connections settings for SonarLint in the latest version of IntelliJ (2020.2) are in the Preferences window at Tools>SonarLint>Project Settings.

- 11
- 2