I've got some code I'm maintaining that has a good deal of machine generated comments and machine generated regions. (or created by a particularly misled developer)
These are comments exclusively repeating the method metadata and space expansions of pascal cased names:
#region methods
/// <summary>
/// Implementation of a public method foo bar, returning a void
/// </summary>
/// <param name="value">A string parameter named value input</param>
public void fooBar(string valueInput)
{
}
#endregion
Is there a plug in or feature of Resharper for stripping out the comments and #region tags in bulk?
Why not use the regex find & replace in Visual Studio?
For triple slash comments:
///.*
For region tags:
[#]region.* [#]endregion
These parts were likely hand-typed:
Implementation of a public method foo bar, returning a void
and
A string parameter named value input
If this is in a class library project, I wouldn't get rid of the xml comments - they are what will show up in the intellisense prompts for those items. Removing them could make other developers very mad at you; for all the text here isn't very good, the default prompts are cryptic and even worse.
I'd say replacing them with something more sensible is much better than stripping them out. As mundane as they may be, having no comments is always worse (unless the comments are incorrect of course? Then no comments is certainly better) :-)
That said, I believe this does what you're looking for.
For region tags, you could try adapting that app or using VS' regex find/replace.
I vote that you go in and fix them as you come across them. I've had to do the same thing here... every time that I go into a class that has bad comments (in my case: none). I comment the methods/properties as I work with them. After 3 weeks, I've properly commented about 1/2 the codebase and have developed a stronger understanding of the entire project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With