views:

65

answers:

1

I use Visual Studio 2010 Premium Code Analysis (CA) capabilities and force them at every compile with my projects while also showing warnings as errors, so I keep my code nice and well... better.

But.

Since this CA is very nice and all I wouldn't want to use StyleCop as well. Because StyleCop gives me code style specification that CA doesn't.

Question

I was wondering whether it's possible to merge rules from StyleCop to CA?
That would be best, so also enforce code style while also checking code itself.

A: 

It wouldn't be possible to get StyleCop rules work under Code Analysis as the former operates on source code while the latter operates on compiled assemblies level.

If you want to try CodeIt.Right (disclosure: this is our product) you will find plenty of configurable and flexible rules that will point out code style violations and also correct them for you.

So, what you can do with CodeIt.Right, if you only want to check for missing XML code documentation, you create a custom profile and only include the XML doc rule(s) into the profile. You then validate code against that profile inside of the VS IDE or as part of the CI/Automated Build process.

sergeb
I'm not sure you're right, because CA also checks naming conventions and such. Those aren't present in compiled code anyway. You're probably thinking of **FxCop** which does code checking on compiled assemblies.
Robert Koritnik