Domanda

We have StyleCop as part of the project and every time we compile, Stylecop is checking the code. But we already have 100K+ lines of code and it only grows every day. So rebuild of the solution is taking longer and longer than 20 seconds already. I think that the worst part of it is Stylecop.

So we are thinking of the way to remove StyleCop from compilation process, but have it as check-in policy for TFS. I have found 2 projects: SourceAnalysysPolicy and StyleCopPolicy. But neither seem to support VS2012 and numerous posts online suggest they do not work in VS2012.

I can slap StyleCop as a step into our build server (TeamCity), but then we'll have a lot of false failed builds - not really a solution.

I was hoping to have to force all check-ins in TFS to be gated check-ins and run stylecop there via MSBuild script: if no violations - actually check-in and pass control over to TeamCity. If there are violations - warn the developer and not check-in. But I've no idea if that is possible in TFS2010 and how to implement it.

Any other ideas?

È stato utile?

Soluzione

I know it's an older post but I just released a check-in policy for Visual Studio 2013. I don't know if you already using VS2013 but take a look at this extension. If you want VS2012 support, you can add an issue. If there are enough votes I will add support for it. https://stylecopcheckinpolicy.codeplex.com/

Altri suggerimenti

As a solution to this problem, we have Stylecop sitting on the build server and checking the rules on every check-in. We initially did have a lot of failed builds because of the stylecop rules, but after a while everybody learned all the rules and got used it. And last 2 months we had no failed builds because of Stylecop. So it all the matter of discipline.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top