Alexander Molodih
Alexander Molodih

Reputation: 1936

How to convert StyleCop rules from version 4.3 or 4.5 to 4.6?

My team are going to new version of resharper, it's 6.

And our old rules don't work on StyleCop 4.6. Our rules was worked on 4.5 version.

Any one know most easier way to convert StyleCop rules from version 4.3 (or 4.5) to 4.6?

Upvotes: 3

Views: 810

Answers (2)

Alexander Molodih
Alexander Molodih

Reputation: 1936

This is solution:

    <StyleCopSettings Version="105">
      <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>
       <!--------Here your old rules----->
      </Analyzers>
    </StyleCopSettings>

Thay also add two new rules: SA1517 and SA1518. That will be on your own.

Upvotes: 1

Nicole Calinoiu
Nicole Calinoiu

Reputation: 21002

It's much the same as upgrading any framework on which your code depends:

  1. Change your references to the new version.
  2. Try to compile.
  3. Adjust for breaking changes until compilation works.
  4. Run your tests.
  5. Adjust for breaking changes until your tests pass.
  6. Deploy, then adjust for breaking changes until the users stop complaining.

There's no magic formula for avoiding this sort of thing, particularly for an free tool where maintaining backward compatilibility is not a priority...

Upvotes: 2

Related Questions