Make ReSharper tell you if you suck

by Grank October 07, 2008 16:00
ReSharper's real-time code analysis is super-awesome and has clued me into a lot of things in the short time I've been using it.
However, out-of-the-box it doesn't bitch at me about zero-code-impact styling issues, as much as I wish it did. I'm sure everyone has their bad-style vices.
Some of you have seen StyleCop, which is a great tool for static code analysis if you want to conform to Microsoft's suggested standards.  Some of which are annoying, but you can enable or disable whatever items you want.  You can also apparently create custom items, though I'm told it's kind of a pain in the ass...  haven't tried to do so yet.
The problem with static code analysis is that it takes a bit of a long time to run, especially on a large project, and then presents you with a couple thousand warnings about Everything You've Done Wrong, which will take you a mountain of time to fix.  Don't you wish you could address its warnings as you write code?  I know I do...
 
 
I stumbled across this ReSharper StyleCop plugin whilst trolling StackOverflow, and it's pretty rad.
 
It's not without its problems obviously, the following of which I've encountered so far:
  • Resharper and StyleCop disagree on some things like usage of this. for private member access, so you just can't appease them both at the same time without disabling that in one or the other (see next point)
  • There's a bug in the StyleCop settings editor that will quietly fail if you try to change more than one setting at once, which took me forever to realize that it was why my settings weren't persisting
  • There's so much stuff to fix in an existing project that you might feel like a bit of an idiot...

But yeah, great tool for keeping code neat and readable and standards-compliant!  Enjoy!

*Requires ReSharper 4.1 and StyleCop 4.3

Tags: , ,

Comments

Add comment


(Will show your Gravatar icon)

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen | Modified by Mooglegiant

About The Author

I'm a software developer and musician in Edmonton, AB.  I write mostly web-based software, primarily on the Microsoft stack.  I have an MCPD and several MCTS, but I've only been at this whole developer thing for a few years, and the truth is that I'm still learning more than knowing.  So these are my adventures and experiments and some of it will probably be blatantly wrong...  Just warning ya.