SonarSource / sonarlint-visualstudio

SonarLint extension for VisualStudio
https://redirect.sonarsource.com/doc/sonar-visualstudio.html
GNU Lesser General Public License v3.0
456 stars 77 forks source link

SLVS should support S4MSB properties #1337

Open duncanp-sonar opened 4 years ago

duncanp-sonar commented 4 years ago

Description

The SonarScanner for MSBuild ("S4MSB") has a number of properties that affect the issues that are reported to SonarQube/SonarCloud e.g. SonarQubeExclude and SonarQubeTestProject.

SLVS does not use these properties, leading to differences between the issues reported in the IDE and issues reported on the server.

Workaround

VS2019 supports disabling live analysis on a per-project basis as a built-in feature. See the MS docs.

Note: postponed pending upcoming work on "Tests as first class citizens"

TODO:

MrDark commented 3 years ago

Since SLVS still does not use the SonarQubeExclude property, is there any other way we can force SonarLint to ignore certain projects within Visual Studio?

Context: We have 1 project which contains externally generated code and causes SonarLint to drop about 800 warnings. Would be great if we remove this clutter.

duncanp-sonar commented 3 years ago

@MrDark if you're using standalone mode then you could use the normal VS ruleset configuration features to create a ruleset that disables all of the rules and reference it from the project that you want to exclude. See the wiki page for more pointers.

If you have further questions about the configuration please open a thread in the community forum - that's a better place to ask support questions.

duncanp-sonar commented 1 year ago

Related community thread: https://community.sonarsource.com/t/not-all-code-smells-showing-up-in-sonar-lint-for-visualstudio/66787/8