Disabling StyleCop Rules

I am using StyleCop. But there are a couple of rules that I want to ignore, for example, using this. in front of class members.

How to disable the StyleCop rule. I looked, but I can not find how to do it.

+64
visual-studio stylecop
Mar 13 '09 at 15:43
source share
3 answers

Your StyleCop installation has a Settings.StyleCop file. You can change this to disable rules worldwide. Drag this file into the settings editor executable file to edit it.

You can also put copies of the settings file in your projects to override the global settings.

If you use integration with Visual Studio, and not just integration with MSBuild, you can get StyleCop Settings to the settings editor for each individual project by right-clicking on your project and choosing " StyleCop Settings or something like that.

+76
Mar 13 '09 at 16:01
source share

This particular rule is found in readability rules - membership access - SA1101: prefix LocalCallsWithThis.

If you turn it off, he should stop yelling at you ... I had to do it. Stylecop is causing me a headache.

+6
Apr 04 2018-12-12T00:
source share

Stylecop is customizable at the project level. Manage rules easily using the graphical interface, instead of editing the settings file. (For some time it was referred to as Stylecop parameters in some versions)

You should see the search / search parameter as soon as you select the parameter option, as shown in the figure below.

Example: if you want to delete a rule where // comments are invalid and //// are allowed by style, search for the identifier of the style rule. In this case, it is SA1005. This can be seen in the warnings section when you start a style in your project. Search with the keyword SA1005 and you will see this in the result section. Just uncheck the box.

enter image description here

You can manage the rules as shown below

enter image description here

+4
Feb 09 '17 at 20:04
source share



All Articles