We want to suppress rules of style cop for all the projects in the developer machine. As you can get few information from the documentation both on global rule setting and rule suppression. Below mentioned are 2 ways to merge them both:
Editing the Settings.StyleCop in notepad
- Go to the installation location of StyleCop (possible location: “C:\Program Files\StyleCop 4.7”)
- Right click Settings.StyleCop file open with notepad.
- Replace below XML Content as a child node of <Analyzer>
-
<Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules"> <Rules> <Rule Name="ElementsMustBeDocumented"> <RuleSettings> <BooleanProperty Name="Enabled"> False </BooleanProperty> </RuleSettings> </Rule> </Rules> </Analyzer>
- The trick to read the above xml can be found here.
- Close and Save the file.
Editing the Settings.StyleCop using the default editor
- Go to the installation location of StyleCop (possible location: “C:\Program Files\StyleCop 4.7”)
- Double click on the file named Settings.StyleCop
- The Rule editor will be open (It will look like this)
- Simply un-check the rules you don’t want in your projects.
- Click Apply and Ok.
Both the solution will give you same result, you can use them as per your convenience.
1 comment