Style suppression

Is it possible to ban StyleCop rules in a more global way, which ... in other words, is it not easy to use the original attributes in a string?

+5
source share
2 answers

You can disable certain style rules by using the Settings.StyleCop file. For example, some of the things built into the style do not conform to our standard. For example, in my Settings.StyleCop file we have:

<Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.ReadabilityRules">
  <Rules>
    <Rule Name="PrefixLocalCallsWithThis">
      <RuleSettings>
        <BooleanProperty Name="Enabled">False</BooleanProperty>
      </RuleSettings>
    </Rule>
  </Rules>
  <AnalyzerSettings />
</Analyzer>

Thus, for a member variable or property, we should not have "this." for each of them.

+8
source

Absolutely!

, StyleCop StyleCopSettingsEditor ( , " StyleCop", ).

Settings.StyleCop . , , XML . StyleCopSettingsEditor - , , .

StyleCop, !
, .
StyleCop.Settings " ". TFS ( ). StyleCop , , " ". ( StyleCop.Settings ).

StyleCop , , - ( Team Project, TFS, , GetLatest ) Settings.StyleCop StyleCop ( , -).

StyleCop , , .

+2

All Articles