views:

341

answers:

7

Hi. Is there a Visual Studio plug-n or add-in which allows you to check code formats and conventions. This would include checking the indention, spacing,line spacing, casing of function names or variables, check if pascal case or camel case, etc. Anything which relates to coding convention. And of course we are allowed to set these. And if possible we can save this settings to be imported for other projects.

It would also be nice if it puts a warning or something on the visual studio editor(e.g. highlighting the line statement) or on the VS console if there are any violations on the convention.

I found Code Style Enforcer and this could have been fine but this needs DXCore from devexpress which is for sale or for a 30-day trial. I need a free add-in. Tnx... :D

+4  A: 

It sounds like you're looking for StyleCop and/or FxCop.

LukeH
Just checked FxCop. I need to investigate on it more. It's quite not easy to use... But tnx... :D
cedric
+2  A: 

Try FXCop or ReSharper

astander
+1 for ReSharper: have found it to be a great tool, offering warnings, hints as well as conventions.
davek
Although ReSharper is undoubtedly excellent, the OP specifically asked for a free add-in.
LukeH
A: 

You're looking for FXCop, a free tool from Microsoft:

http://msdn.microsoft.com/en-us/library/bb429476%28VS.80%29.aspx

jrista
+2  A: 

The StyleCop plugin for ReSharper is free, however ReSharper is not. If you've already got ReSharper, happy hunting. If you don't, you really should. =)

You want the plugin if you want active syntax highlighting instead of post-build analysis.

J. Steen
A: 

StyleCop along with StyleFix and GhostDoc make a great "FREEsome threesome".

I've heard of CodeStyleEnforcer but haven't tried it... Yet. (Downloading now)

Brad Bruce
+1  A: 

The more expensive editions of Visual Studio 2008 include Code Analysis, which is essentially FxCop built into the IDE. You can check if you have it because a "Code Analysis" tab appears on the project properties. If you don't have it then I back the recommendation to try FxCop, although I'm not sure if it will be maintained in the future.

ShellShock
A: 

There's also Regionerate which does the same thing as FxCop, but it's free.

Bobby
Wrong on both counts. FxCop is also free, and Regionerate does not do the same thing as FxCop.
Joel Mueller