Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Automatic File Header Creation (ReSharper and StyleCop)

I recently installed R# 6.1 (C# version, not Full) with StyleCop 4.7.34.0 (with the R# plugin). When adding a new class to a project, the file header information is automatically added. How do you disable this?

I've turned off the checkbox for "Insert text into documentation and file headers" within the R# options for StyleCop (Options > Tools > StyleCop > Headers section).... but still no luck.

I've also turned off StyleCop rules SA1633 to SA1640 that requires the header documentation.

I found this related post that suggests:

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

but I don't have a "Code Cleanup" node in my tools section. Not sure if the fact that I'm using a "C#" version of R# has something to do with it.

like image 481
ryan Avatar asked Jul 11 '12 22:07

ryan


1 Answers

The problem is actually because of this: http://stylecop.codeplex.com/discussions/348351/

When you try to uncheck the StyleCop settings under Code Cleanup (Options > Code Editing > Code Cleanup > StyleCop > 1600 and 1633-1641) and click Save it does not actually save the changes! This seems to be a bug in ReSharper.

The only workaround i've found is to make a new profile (Add) and immediately uncheck 1600 then click Save. This will have to be set as the Profile to use on silent cleanup. Good luck


EDIT: here are the settings for my profile that is set as the 'silent cleanup' one. It does not add the headers. hope that helps ReSharper Code Cleanup Profile

like image 197
arserbin3 Avatar answered Oct 24 '22 16:10

arserbin3