There is a point to this story, but it has temporarily escaped my mind...
Contact Me MyFaceBook MyLinkedIn MyGitHub MyTwitter

My StyleCop Settings

I like using the Microsoft StyleCop to make my code consistent and I ask the developers I work with to use it too. It helps ensure consistent formatted code regardless of the developer writing the code. I do however, disagree with a few of the default settings such as insisting that every code file have a file header. I also only think that public methods/properties should be required to have XML comments since those are the types that show up in intellisense. I also can't “control” auto-generated code so why should it be checked for style. Probably best to leave those files alone anyway.

Anyway, This is my main StyleCop Setting File:

<StyleCopSettings Version="105">
  <GlobalSettings>
    <BooleanProperty Name="WriteCache">False</BooleanProperty>
  </GlobalSettings>
  <Parsers>
    <Parser ParserId="StyleCop.CSharp.CsParser">
      <ParserSettings>
        <CollectionProperty Name="GeneratedFileFilters">
          <Value>\.g\.cs$</Value>
          <Value>\.generated\.cs$</Value>
          <Value>\.g\.i\.cs$</Value>
        </CollectionProperty>
      </ParserSettings>
    </Parser>
  </Parsers>
  <Analyzers>
    <Analyzer AnalyzerId="StyleCop.CSharp.NamingRules">
      <AnalyzerSettings>
        <CollectionProperty Name="Hungarian">
          <Value>as</Value>
          <Value>do</Value>
          <Value>id</Value>
          <Value>if</Value>
          <Value>in</Value>
          <Value>is</Value>
          <Value>my</Value>
          <Value>no</Value>
          <Value>on</Value>
          <Value>to</Value>
          <Value>ui</Value>
        </CollectionProperty>
      </AnalyzerSettings>
    </Analyzer>
    <Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
      <Rules>
        <Rule Name="FileMustHaveHeader">
          <RuleSettings>
            <BooleanProperty Name="Enabled">False</BooleanProperty>
          </RuleSettings>
        </Rule>
        <Rule Name="FileHeaderMustShowCopyright">
          <RuleSettings>
            <BooleanProperty Name="Enabled">False</BooleanProperty>
          </RuleSettings>
        </Rule>
        <Rule Name="FileHeaderMustHaveCopyrightText">
          <RuleSettings>
            <BooleanProperty Name="Enabled">False</BooleanProperty>
          </RuleSettings>
        </Rule>
        <Rule Name="FileHeaderMustContainFileName">
          <RuleSettings>
            <BooleanProperty Name="Enabled">False</BooleanProperty>
          </RuleSettings>
        </Rule>
        <Rule Name="FileHeaderFileNameDocumentationMustMatchFileName">
          <RuleSettings>
            <BooleanProperty Name="Enabled">False</BooleanProperty>
          </RuleSettings>
        </Rule>
        <Rule Name="FileHeaderMustHaveValidCompanyText">
          <RuleSettings>
            <BooleanProperty Name="Enabled">False</BooleanProperty>
          </RuleSettings>
        </Rule>
        <Rule Name="FileHeaderFileNameDocumentationMustMatchTypeName">
          <RuleSettings>
            <BooleanProperty Name="Enabled">False</BooleanProperty>
          </RuleSettings>
        </Rule>
      </Rules>
      <AnalyzerSettings>
        <BooleanProperty Name="IncludeFields">False</BooleanProperty>
        <BooleanProperty Name="IgnorePrivates">True</BooleanProperty>
        <BooleanProperty Name="IgnoreInternals">True</BooleanProperty>
      </AnalyzerSettings>
    </Analyzer>
    <Analyzer AnalyzerId="StyleCop.CSharp.ReadabilityRules">
      <Rules>
        <Rule Name="UseBuiltInTypeAlias">
          <RuleSettings>
            <BooleanProperty Name="Enabled">False</BooleanProperty>
          </RuleSettings>
        </Rule>
      </Rules>
      <AnalyzerSettings />
    </Analyzer>
  </Analyzers>
</StyleCopSettings>
Copyright © 2015 by Julian Easterling. SOME RIGHTS RESERVED.

Creative Commons License
Except where otherwise noted, content on this site is
licensed under a Creative Common Attribution-Share Alike 4.0 International License.


All of the opinions expressed on this website are those of Julian Easterling and
do not represent the views of any of my current and previous clients or employers in any way.

If you notice an error on the site or content that has not been properly attributed, bring
it to my attention using the contact page and I will endeavor to fix it as soon as I can.

I accept no responsibility or liability for any damages incurred by following any of
my advice or by using any of the information on my site or of those sites that I link to.