SonarSource / sonarlint-visualstudio

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

Handle deprecated rule keys in configuration #1197

Closed duncanp-sonar closed 1 year ago

duncanp-sonar commented 4 years ago

Description

Sonar analyzers have the ability to deprecated rule keys i.e. change the key for a rule, and list the old key as "deprecated". The SonarLint daemon has been updated to handle deprecated rule keys.

However, there could be problems if rule keys are stored locally on the developer machine. This could happen the following areas:

Related: SLVSCODE-111

Impact:

The set of rules being executed could be incorrect; the wrong rules parameters could be used; the wrong severity could be reported.

Issues that have been suppressed on the server are not suppressed in the UI.

Options:

Breakdown by language

C# and VB.NET

Rule configuration

Rule configuration is stored in ruleset files. To date, C#/VB have never changed the ID of a rule/diagnostic. The likelihood of this ever happening is considered low.

Issue suppression

Currently the list of suppressions is fetched from the server - nothing is stored locally. Note that this might change in the future to improve performance (and prevent a gold bar from being displayed) - see #1005)

JavaScript

Currently configuration of JS rules/issue suppression is not supported in standalone or connected mode, so rule keys are not stored locally -> no impact.

C/C++

Rule configuration

C/C++ supports rule configuration in both standalone and connected mode.

Question: have C/C++ rule keys have every been deprecated? Answer: no, no rule keys have been deprecated to date. Yes, rule keys changed in v6.32 However, some rules are marked as deprecated, which is a separate thing (status=DEPRECATED)

Issue suppression

Issues suppression is not currently supported. See #1107. Done.

duncanp-sonar commented 1 year ago

Closing as obsolete. Handling of legacy C++ has been added.