Ability to disable analysis with #pragma in Rider

Please provide

  • Operating system: Windows 11 Pro
  • SonarQube for IntelliJ plugin version: 10.19.0.80823
  • IntelliJ version: Rider 2024.3.6
  • Programming language you’re coding in: C#
  • Is connected mode used: No
    • SonarQube Cloud, SonarQube Server, or SonarQube Community Build? (if one of the latter two, which version?):

It does not appear that there is an option when using Rider to disable analysis at a specific location or file with a comment. This option appears in Visual Studio. Is there any plans to add this to the Rider plugin? Thanks.

Hi there,

Would you mind giving some specifics on

  • which rules you are not able to silence
  • which filetypes this occurs in
  • which means of silencing you used (pragmas, attributes, .editorconfig…)

Since our C# analyzer is built on top of Roslyn, it should honor those normal means of disabling a rule.

If you are talking about the Visual Studio “light bulb icon” with auto-generation of pragmas/editorconfig/attributes, this is a feature of Visual Studio itself, not of SonarQube for IDE.

Denis

When using Resharper for Visual Studio I can press Alt + Enter on any code issue found by the plugin and there is an option to disable it with #pragma once or in the file. This option does not seem to exist in Rider. It only gives me the option to view more details about the issue or disable it completely. The ability to have the #pragmas generated easily is what is missing in the Sonar IDE for product that seems to exist in the visual studio. It may be that it is Visual Studio or Resharper generating that option and not the Sonar plugin. If that is the case, please let me know and I can file the appropriate ticket with the Rider folks. Thanks.

To my knowledge this is a feature of the IDE itself, yes.

Ok. I’ll open a ticket with the Rider folks and see if this is something that can implement. Once I do I can post the Rider issue report link here. Thanks.

Opened Feature Request with JetBrains.

2 Likes