SonarLint doesnt synchronize the rules from the analysis scope in SonarQube

Hello Sonar Community,

i got following problem. If i setup the analysis scope for example disable a rule via “multiple criteria” and see that the configuration works in sonarqube but SonarLint still show us the issue. Is there a way that SonarLint synchronize the analysis scope aswell?

Hello @JustinDroege,

By Analysis Scope, it looks that you refer to the Quality Profile concept, right?
To make SonarLint uses your Quality Profile, you must connect it to your SonarQube, by binding your project. I invite you to read our product wiki, in particular the Connected mode page.

Does that help?

At the moment, we are trying to disable a rule with pattern on just some files and not the full code base and there is the problem that SonarLint doesnt synchronize this “analysis scope” rules.
Im refer to this : “https://docs.sonarqube.org/latest/project-administration/narrowing-the-focus/

SonarLint is already connected with our SonarQube Instance

Ah ok, so in other terms: SonarLint does no honor exclusions (sonar.exclusions) setup on SonarQube, while he is connected to this SonarQube.

In that case, could you tell us more about your context?

  • SonarLint Version
  • What kind of project
  • How exclusions are configured on SQ (screenshot(s))
  • Logs from SonarLint

Thank you for your help.
Here are the informations:

  • What kind of project
    • Dotnet Core 3 (C#)
  • SonarLint Version
    • 4.21.0.16909 (Visual Studio)
  • Sonarqube Version
    • Community EditionVersion 8.0 (build 29455)
  • How exclusions are configured on SQ
    1. At this Picture we can see, i disabled the rule ‘S1118’ of any kind of issue repositorie
    2. Here we can see that the issues gots on sonarqube side resolved (We have two entrys because i change the structure in the past)
  1. The project is binded with sonarqube. The issue is still active on the SonarLint side

Where i can find the SonarLint log?

Hello @JustinDroege,

As you confirmed that you are using Visual Studio, I can confirm that what you experienced is expected. SonarLint for VisualStudio does not use server-side settings such as exclusions or issues ignore mechanisms, the connected mode will only sync the Quality Profile (rules used for analysis) and sync issue statuses.

We have a ticket in our backlog to handle that: #1335 Apply server settings in connected mode, so stay tuned!

Cheers

1 Like