Improvements to Resharper to fit in with StyleCop methodology

May 29, 2011 at 5:03 PM

I have made two suggestions to JetBrains regarding improvements to ReSharper to make its modifications to C# code more closely fit the requirements of StyleCop whilst minimising the need for further manual changes. I would appreciate those of you with accounts at JetBrains, to vote for these changes.

The first is http://youtrack.jetbrains.net/issue/RSRP-186206 - this deals with certain predfined ASP.NET method names such as Page_load that ReSharper should ignore. Resharper's rule for method names could be modified to allow underscores but then underscores would be allowed in all method names. The best route for all is that these exceptions to the general rule be excluded by ReSharper.

The second is http://youtrack.jetbrains.net/issue/RSRP-268868 This deals with ReShaper code optimisations as the following:

 if (c == '\r' && this._delimiter != '\r')
{
return true;
}
else
return false;

Remove redundant else gives:

if (c == '\r' && this._delimiter != '\r')
{
return true;
}
return false;


... and what is required is one blank line after the close brace:

if (c == '\r' && this._delimiter != '\r')
{
return true;
}

return false;