SonarLint not loading sonar.issue.ignore.multicriteria for c# from SonarQube Server V9.9

  • Operating system: not sure(managed by corporation)

  • SonarLint plugin version: 6.16.0.69538

  • Programming language you’re coding in: c#

  • Is connected mode used: yes

    • Connected to SonarQube: Enterprise Edition Version 9.9 (build 65466)
  • VisualStudio version: VS 2022 Enterprise

Background
We have >100 microservices each with an own project in sonarqube. In order to get feedback asap, we need to enable engineers to run local checks before commiting new code.
We want to control the behavior centrally with the sonarqube server to support teams faster.

Issue
We have configured successfully the connect to the server.

  • setup is:
    • abc.solution with the following projects
      • abc
      • abc.Unittests
      • abc.Integrationtests
      • abc.Migrations
  • we now want to add new a new sonar.issue.ignore.multicriteria
    → Rule Key Pattern: csharpsquid:S1301
    → File Path Pattern: **/*Controller.cs
  • save the changes
  • we now open visual studio extension sonarlint and click on update
  • that adds or updated the SonarLint.xml in the main project folder (abc)

Expect

  • sonarlint.xml contains those rules as well
  • vs is not showing the excluded rules as issues

Actual

  • sonarlint.xml does not contains those rules
  • vs is showing the excluded rules as issues

Is that implemented for c# or do we need another version of the server?

Hi @matttrakker - welcome to the community.

No, unfortunately. The multicriteria are not current supported in VS (see here).

cc @Marco_Comi

Thanks duncanp for the fast reply.
Is there any option to support large (number of) teams to use the software effieciently?
The porperties file is also not working as far as I see, right?

SonarLint for Visual Studio does not use the sonar-project.properties file, no.

Your options are limited at the moment: either disable S1301 completely in the Quality Profile, or set sonar.exclusions to ignore all controllers. However, these settings would apply in both VS and to the server analysis.

ok, got it - thanks once more.
Really my last question: Any plans on the feature roadmap to change the current situation? :slight_smile:

Hi Matthias,
we’ve recently started to support file inclusions/exclusions and we may be able to add the multi-criteria case sometime in the future, it makes a lot of sense for SonarLint to reflect the server configuration for analysis. However, considering the other priorities we have for SonarLint, we don’t expect to work on that soon I am afraid.

Hi Marco_Comi,

thanks for the clarification. It really blocks us from using it efficiently :frowning:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.