ReSharper - how to disable generation of rubbish documentation headers in Code Cleanup
Asked Answered
T

2

8

We're using ReSharper 6.0 with StyleCop for ReSharper.

Although we use the StyleCop rule that members must have documentation headers, we don't want ReSharper's code cleanup facility to generate documentation headers for us, because they're inevitably rubbish. Bad doc headers are worse than none at all because they're less likely to be updated than added in the first place.

We tried turning off the setting 'Insert text into documentation and file headers' in ReSharper => Options => Tools => StyleCop but it bloody resets itself when you restart visual studio.

Any ideas how we can stop Code Cleanup creating documentation headers for us?

Troopship answered 17/11, 2011 at 10:14 Comment(0)
T
8

ReSharper -> Options -> Tools section -> Code Cleanup -> select StyleCop profile -> Documentation section -> untick 1600.

Will prevent default documentation headers being created but StyleCop will still enforce that they should be there.

Troopship answered 17/11, 2011 at 10:29 Comment(2)
For me, I had to set 1639: Update file header to Do not change.Dressel
Also, if you are using a custom file header, and don't want to replace it with the standard StyleCop header, untick 1633-1641: Update file header under StyleCop -> Documentation.Demagogy
E
0

The second step, after blocking code generation is Removing the rubbish. I used a regex Search/Replace through visual studio.

Regex is for header :

// ---.*\r\n\/\/.*\r\n\/\/.*\r\n\/\/.*\r\n\/\/.*\r\n\/\/.*\r\n.*\r\n\/\/.-{116}

Regex to remove Generated summaries

\s{4}\/\/\/\s<summary>(.*)\r\n.*\r\n.*</summary>

Caution : it will remove ALL summaries, even the good ones, so check the replacement scope before launching it. (git checkout might be your friend...)

Elma answered 17/9, 2015 at 13:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.