Can I configure the used ruleset for SonarLint

the_jov picture the_jov · Oct 12, 2015 · Viewed 10.2k times · Source

Can I disable / enable the set of rules that are shown by SonarLint for VS? How? A similar question was already asked in Is there some graphical way to create my own configuration file on SonarLint? but I wasn't able to follow the answer, i.e. did not find the Project/References/Analyzers node in the Solution Explorer, to be able to edit the active rule set file. Can you help me out on this one?

Answer

Dinesh Bolkensteyn picture Dinesh Bolkensteyn · Oct 13, 2015

Here is how to open the active rule set of a project:

How to open Active Rule Set from Solution Explorer in VS2015

From there, you'll be able to enable and disable rules:

Toogle rules in VS2015

The path to the rule set file to be used is saved within your .csproj file under the <CodeAnalysisRuleSet>...</CodeAnalysisRuleSet> tag. You can reference the same rule set file from multiple projects, and store the rule set along with your project sources in Git / TFVC if you'd like all developers to share the same rule set.