tags:

views:

87

answers:

3

I am very new to Resharper and trying to implement all the suggestion it gives. Can I do it automatically? I have tried code cleanup. but that wont do all of them. Also I need to remove all commented code. How can I do it? Also I am running it with a silverlight application. Is there any chance of breaking something if I auto accept the suggestions?

+1  A: 

I don't believe there's a way to do this.

Even if there were, ReSharper will often give you a choice of actions to take - which would be accepted if this were done automatically?

John Saunders
A: 

If you can find examples that you think ReSharper should cater for automatically, you might like to request the feature on their Jira site and post the link here for others to vote on:

http://www.jetbrains.net/jira/browse/RSRP

Drew Noakes
+2  A: 

It may be more work, but you should apply any cleanup operation "manually" so that you know what has been changed in your code, can learn from those changes, and can be sure that all the changes are correct. Code Analysis tools offer you suggestions, but they are never 100% correct - sometimes you need to do a bit of the programming yourself ;-)

Don't think of it as a chore. Think of it as a (tedious and repetitive) way of learning a better coding style. THe more often you accept a specific change, the more strongly you will remember the "better" way to write similar code the next time.

Jason Williams
+1 - ditto. I did the same sort of manual cleanup with FxCop violations and learned a lot from that. Once it's clean, keep it clean - keep R# green, turn on Warnings as Errors, and consider running FxCop under Continuous Integration.
TrueWill

related questions