0

I am manually editing a Settings.StyleCop file to configure stylecop in VS2012. So far, I've had success suppressing many unwanted rules, but SA1504 won't go away. I'm using stylecop 4.6.

Here's a snippet of my settings file:

<StyleCopSettings Version="4.3">
   <Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.LayoutRules">
      <Rules>
    <Rule Name="AllAccessorMustBeMultiLineOrSingleLine">
          <RuleSettings>
            <BooleanProperty Name="Enabled">False</BooleanProperty>
          </RuleSettings>
        </Rule>
      </Rules>
   </Analyzer>
</StyleCopSettings>

Note that the version in the file is 4.3, but changing it to 4.6 doesn't fix the problem and in fact makes all the rules in the file not work.

Can anyone explain the behavior I'm seeing and/or point me to documentation for a Settings.StyleCop file?

ChaseMedallion
  • 20,860
  • 17
  • 88
  • 152

1 Answers1

1

Perhaps because the rule's name is "AllAccessor*s*MustBeMultiLineOrSingleLine"? (The StyleCop settings UI application should generate XML with the correct rule name if you're in any doubt.)

Nicole Calinoiu
  • 20,843
  • 2
  • 44
  • 49
  • Interesting, I got my names from http://stylecop.soyuz5.com/Layout%20Rules.html which must be wrong... This fixed it! Where did you get the stylecop rule name list? – ChaseMedallion Apr 24 '13 at 17:47
  • This time around, I just used Reflector to look at the resources embedded in the rules DLL. The source code at http://stylecop.codeplex.com/ is another potential source. – Nicole Calinoiu Apr 24 '13 at 17:53