Skip to content

Scanner should allow overwriting server-side properties #816

@andrei-epure-sonarsource

Description

Problem

The SonarQube language settings (C# / VBNET) cannot be overwritten from the Scanner for MSBuild command line.

Note: a discussion with the PMs should be triggered to decide whether this is a true problem or not.

Describe the solution you'd like

Pass a command-line argument to the S4MSB to overwrite server-side settings.

Describe alternatives you've considered

There is no alternative other than, after the Begin step and before the Build step, manually change the SonarLint.xml file

Additional context

Currently, the communication between the Scanner for MSBuild and the SonarAnalyzer is done via the SonarLint.xml file (.sonarqube\conf\cs\SonarLint.xml for C#). This contains:

  • settings (for C# - sonar.cs.analyzeGeneratedCode, sonar.cs.file.suffixes , sonar.cs.ignoreHeaderComments)
  • rule parameters (e.g. for S110 the max parameter)

There is also the .sonarqube\conf\SonarQubeAnalysisConfig.xml file which contains

  • ServerSettings - scanner properties (which are passed to the scanner-cli)
  • AnalyzersSettings - settings passed to the C# and VBNET analyzers - specifies the path to the ruleset file and to the aforementioned SonarLint.xml file

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions