Suppress warning by generating code

  • Operating system: Windows 11 Pro
  • SonarLint plugin version: 10.9.0.79423
  • IntelliJ version: JetBrains Rider 2024.2.4 Build #RD-242.21829.210, built on September 6, 2024
  • Programming language you’re coding in: C#
  • Is connected mode used:
    • Connected to SonarQube: Developer Edition v10.6 (92116)

Currently the SonarLint plugin does not allow me to suppress a rule violation warning by generating the appropriate code that will then decorate the violating line with the SuppressMessageAttribute or #pragma warning disable.

As a Rider user I am used to do this for any other type of warning and it is especially surprising that it does work with the Visual Studio SQ plugin and also with the SonarAnalyzer.CSharp nuget package, just not with the IntelliJ/Rider SQ plugin.

This is somewhat annoying because writing the full SuppressMessageAttribute by hand with all the correct details is quite involved:

2 Likes

Hi Bitbonk,
Thanks for sharing the importance of this improvement. We are not considering it for the roadmap at the moment, but I’ve discussed it with the team and we are keeping a record of all similar requests. We’ll update this thread if anything changes.
Have a nice day.
Farah.