sonarlint-visualstudio icon indicating copy to clipboard operation
sonarlint-visualstudio copied to clipboard

SLVS should support S4MSB properties

Open duncanp-lseg opened this issue 5 years ago • 3 comments

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:

  • confirm with PM that this is the behaviour we want
  • are there any other properties we should support?
  • does those S4MSB properties apply to all languages, or just C#/VB?
  • can we handle conditional MSBuild properties inside VS? (VS doesn't seem to do a good job of applying these)
  • should the properties be applied even if the user is not in connected mode (since the data is available in the MSBuild project file)?

duncanp-lseg avatar Apr 17 '20 16:04 duncanp-lseg

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.

MrDark avatar Oct 06 '20 13:10 MrDark

@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-lseg avatar Oct 08 '20 09:10 duncanp-lseg

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

duncanp-lseg avatar Aug 16 '22 13:08 duncanp-lseg