Been playing a lot recently with ReSharper and one thing I'd love to setup for my team are notifications if a C# class or C# file doesn't have a set code commenting standard. Unfortunately I have not yet been able to find much on the topic.
For example, I'd like to ensure all methods or functions have a comment description above them:
/// <summary>
/// Description of MyMethod here.
/// </summary>
public void MyMethod();
I would like to also see that a basic check for whether (Number of lines of code) / (Number of lines of comments) is around some magic happy-medium, and create a notification or warning if not.
One simple option to start with (which doesn't even need R#) is to turn on the generation of an XML documentation file, and then treat warnings as errors. That will ensure that every public member has documentation.
It won't ensure that the comments are good, of course... but it will ensure they exist.
EDIT: R# does have a setting for this - under Code Inspection, Inspection Severity, C#, Compiler Warnings, look for CS1591: Missing XML comment for publicly visible type or member
(and related warnings near it). Change the severity of that to Error and it might help you - but it's hard to say as you're in an unusual environment.
Not to compete with Jon but GhostDoc does what you're describing.
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