Can StyleCop automatically fix anything?

后端 未结 9 2294
盖世英雄少女心
盖世英雄少女心 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:52

    No, frustratingly. That's why Style Cop is counter-productive. Consistent formatting looks nice, but there's little productivity benefit to it (what really makes code hard to read is length and indirection). Perfect spacing is not worth spending hours adjusting lines by hand.

    Of course, if there were an automated tool to achieve consistent formatting, I'd hook it up post-check-in, and let it help me. But Style Cop is made by sadists. Presumably their conversation went like this:

    Bob: Using pattern matching, the software identifies ugly code
    Charlie: —and fixes it!
    Bob: No, it prints a message about each transgression
    Charlie: —and then the user right-clicks to fix them all?
    Bob: No, it scolds them 'invalid spacing around the comma'
    Charlie: —and then explains how to fix it?
    Bob: No, that's in a separate document
    Charlie: —on Google?
    Bob: No.

    I hate Style Cop. It's below a minimum viable product.

提交回复
热议问题