tags:

views:

391

answers:

3
+5  Q: 

Automatic StyleCop

StyleCop is an awesome little add-on for visual studio. But it doesn't show you live hints or provide any automated fixes.

Along comes reSharper and StyleCop for reSharper, this is the ideal solution, however it costs too much.

Is there an open source way to achieve the live code hints and automated fixes for style cop?

Or is reSharper the only way to do this at present?

Thanks in advance...

+1  A: 

You can try the StyleCop for CodeRush plugin. You only need to install the DXCore plugin from DevExpress (which is free). One warning: this project is in alpha and there doesn't seem to be any activity.

Steven
+1  A: 

Well, there is one way to achieve a small amount of automated StyleCop fixes for free without installing any new software. That's right, read my lips, no new software!

Visual Studio has lots of build-in features that will fix a lot of StyleCop errors. All you have to do is set it up and use them. Listen up, and I'll tell you more!

Some of my personal favourites are:
- the right-click Refactor window (rename anything, anytime, everywhere!)
- Edit/Advanced/Format Document combined with modifications to the Visual Studio settings in Tools/Options/Environment and saving those settings out in a .vssettings file and storing those settings with the solution. Make Visual Studio enforce your style! Hoo-ah!
- Custom Snippets! Make that full page of boilerplate appear with only three keystrokes! I know you've had dreams about this kind of productivity!

But wait, there's more!

As for "live hints", if you right-click on the StyleCop violation in the error list you can get a link to the appropriate section of documentation to help you out! Right there, where you want it, when you want it!

By no means as fully featured as ReSharper, but a bargain at the low-low price of nothing! You can't turn down this deal!

(offer not fully valid to those using MSBuild integration)

Task
A: 

I have recently begun another DXCore Plugin

CR_StyleNinja is a free plugin for the CodeRush / CodeRush Xpress / DXCore

See the CR_StyleNinja plugin page on the community plugin site

At the time of writing, the SA13xx series of naming rules are implemented (complete with fixes). I have also started the SA14xx series and the SA11xx series.

Additionally rules will apply themselves across language boundaries where appropriate. Thus rules can be applied to C# or VB.Net or any other language supported by the DXCore.

The site has many other plugins written by several members of the community. If you wish to learn more about any of them, or if you'd like to know more about CodeRush, CodeRush Xpress, RefactorPro or the DXCore, then feel free to contact me. Details on my Community plugin Author page

Rory Becker