I am using SonarLint (version 18.104.22.168639) in ConnectedMode with SonarQube (Enterprise Edition, version 8.1 (build 31237)) under Visual Studio Professional 2017 (version 15.9.36).
Now I’ve been looking for some time for a way to disable a single warning reported by SonarLint/SonarQube in a C++ sourcefile.
Unfortunately I haven’t found anything about this in the FAQs.
All I have found so far is the possibility to exclude a line with “//NOSONAR” from the analysis. However, this comment only affects the result of SonarQube. SonarLint still reports the warning.
Moreover, the solution “//NOSONAR” is too radical for me.
Surprisingly, @SuppressWarnings("squid:S…) works for both SonarLint and SonarQube in a C++ source file, but unfortunately this is not a solution, since Visual Studio’s IntelliSense, and of course the compiler, consider this as an error.
Hence my question:
How can I disable an Error/Warning/CodeSmell in the C++ sourcefile or for SonarLint and SonarQube for a single line?