Search code examples
sonarlintsonarlint-vs

Can I configure the used ruleset for SonarLint


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?


Solution

  • 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.