Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add stylecop check as a pre-build action to VS2010?

In our project we have added StyleCop task to be executed after each commit by continuous integration server. The problem is that build often breaks because someone forgets to run Stylecop before commiting code to repository.

The solution will be to execute StyleCop before each VS2010 build. How can I do it? Maybe it is possible to execute pre-build action per whole solution?

like image 527
Robert.K Avatar asked Dec 09 '25 14:12

Robert.K


1 Answers

It seems you could use MSBuild integration (look here or here), which will make StyleCop checking a part of a build process.

Or you could use some sort of "commit policies" which run StyleCop during the commit and reject the commit if StyleCop checking is not passed. For example, here is one for TFS.

like image 115
Oleg Shuruev Avatar answered Dec 12 '25 15:12

Oleg Shuruev