How to get rid of StyleCop

半腔热情 提交于 2019-11-30 17:53:35

I disabled StyleCop by adding the following GlobalSettings configuration to the file settings.stylecop in the solution root.

<StyleCopSettings Version="4.3">
  <GlobalSettings>
    <BooleanProperty Name="RulesEnabledByDefault">False</BooleanProperty>
  </GlobalSettings>
  ...
</StyleCopSettings>

Why remove it?
In my opinion using StyleCop is a good thing.
Your only problem seems to be that your team member didn't set up StyleCop properly.

From your description, I guess that he wanted to set up StyleCop with MSBuild integration: http://blogs.msdn.com/b/sourceanalysis/archive/2008/05/24/source-analysis-msbuild-integration.aspx

He apparently just left out the last paragraph "Team Development": copy the StyleCop files into your project and check them into source control, so you don't need to install StyleCop on every single developer machine. (see my link for a more detailed description)

If you do this, StyleCop should work on every machine, no matter if it's installed or not.

We are using StyleCop in this way as well, and I think it's the easiest way to use it.
I just had to insert two lines into each .csproj file and check a few files into source control once...and StyleCop just works, on every compile, on every machine (no matter if it's on a developer machine or the build server).

Stylecop hides real warnings. Its a vanity exercise and its evil.

Do not use it.

I find that stylecop generates many many trivial warnings that drown out the real warnings. By all means use these tools but don't force them to be on. Having no stylecop warnings is a meaningless metric.

tom redfern

TEST DRIVEN DEVELOPMENT

Red -> Green -> Refactor

TEST DRIVEN DEVELOPMENT (WITH STYLECOP)

Red -> Red -> WTF? -> Red -> Red -> ...

Also, from here:

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. The message scolds them 'invalid spacing around the comma'.
Charlie: And then explains how the user can fix it?
Bob: No, that information is in a separate document.
Charlie: On Google?
Bob: No.


This is why don't use Stylecop.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!