Unable to sync SonarLint rules from SonarCloud

Please provide

  • Operating system: Windows 10.0.19045 Build 19045
  • Visual Studio version: Version 17.8.3
  • SonarLint plugin version: 7.5.0.82292
  • Programming language you’re coding in: C#
  • Is connected mode used: Yes
    • Connected to SonarCloud (and which version): Unsure how to check this version.

And a thorough description of the problem / question:
VS 2022, installed SonarLint.
Set it up on an organization SonarCloud config.
Linked the project. Set up quality gate rules.
I enabled the connected mode and connected it to the project configured above.

I have disabled localization warnings in the quality gate. I am still getting warnings for localization intentionality in the VS IDE.
An example: C# static code analysis
In the quality gate for the C# profile linked to the project in question, this rule, “Literals should not be passed as localized parameters”, is listed under the inactive rules.

I have tried updating the binding.

How can I get the local sonar lint to follow the rules set in the quality gate?

1 Like

Hey there.

Can you share your VSCode logs?

This is for Visual Studio, not VS Code.
How can I get equivalent logs in VS?

Any update on this issue?

Update for versions. Reimaged Windows. This is still an issue.

  • Operating system: Windows 10 21H2 (Build 19044.4529)
  • Visual Studio version: Version 17.10.2
  • SonarLint plugin version: 8.0.0.92083
  • Programming language you’re coding in: C#
  • Is connected mode used: Yes
    • Connected to SonarCloud (and which version): Unsure how to check this version.

Other details that might be relevant:
We tried disabling other rules that have not been disabled in the linter. E.g., C# static code analysis
However, we have enabled a rule for line width, and the linter correctly flag these issues in the VS IDE - C# static code analysis

We discovered why this was happening.
We have overridden the severity of all sonar issues in our .editorconfig to separate some into warnings and some into errors (based on if they are security related or other categories).
We assumed that we could disable a rule in sonarcloud and it would stop tracking in the editorconfig overrides, but it turns out we first get the rules from cloud, then the editorconfig overrides are applied.
In turn, our pipelines pass with no issue, while our local IDEs scream about some disabled rules being broken.

This is just as an FYI in case anyone else discovers this at a later point.

1 Like

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