Can StyleCop automatically fix anything?

后端 未结 9 2165
盖世英雄少女心
盖世英雄少女心 2020-12-30 22:20

I\'ve decided to start running StyleCop on a medium sized project and am getting over 1000 warnings.

Is there a quick easy way to fix most of these warnings? Most of

相关标签:
9条回答
  • 2020-12-30 22:55

    There is a project in codeplex which does some automatic fix based on stylecop warning. It is not complete however...

    see: http://stylefix.codeplex.com/

    0 讨论(0)
  • 2020-12-30 23:00

    Unfortunately, right now, I don't know of any automatic tools to fix things entirely.

    However, if you setup Visual Studio's formatting options (and Resharper's, if you have that) for code formatting to match the style cop guidelines, cleanups get a bit easier.

    Once you've done that, you can go into a file and do Edit->Advanced->Format Document (or the keyboard shortcut, which varies with your shortcut settings - mine is Ctrl+K, Ctrl+D). This will fix quite a few of the style cop warnings, especially if you have resharper + the stylecop plugin. It won't fix all of them, but in many cases, it's taken the number of warnings in a file from hundreds down to tens.

    0 讨论(0)
  • 2020-12-30 23:01

    Code Maid does some Stylecop fixes.

    0 讨论(0)
提交回复
热议问题