Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to globally disable file headers documentation in ReSharper plugin for Visual Studio

Environment

I am using Microsoft Visual Studio 2013 Update 4 with ReSharper 9.0 Update 1.

I have ReSharper.StyleCop (for R# 9) (https://github.com/kubiix/ReSharper.StyleCop) ReSharper plugin installed version 4.7.50-beta3:

enter image description here

The problem

Operations like removing unused usings in a file seems to execute the silent cleanup which, unconfigurably, inserts file header and documents all class members.

If I have this code:

using System;

public class Class
{
}

And choose the StyleCop option to Remove unused directives in file

enter image description here

the code becomes:

// --------------------------------------------------------------------------------------
// <copyright file="RunThisCode.cs" company="">
//   
// </copyright>
// --------------------------------------------------------------------------------------

public class Class
{
}

Question

The cause of the problem seems that the Code Style page of ReSharper configurations shows an Update File Header Style entry for StyleCop which is set to Insert header if it's missing.

Unfortunately, there seems to be no option for the moment to completely deactivate that header (e.g. by an option Do not change).

Is there a way to overcome this problem? Or is there a way to globally disable file headers documentation in ReSharper?

like image 222
Nikolay Kostov Avatar asked Feb 19 '15 16:02

Nikolay Kostov


1 Answers

I can't run the plugin so not able to verify, but reading the documentation gives the impression it is possible.

Under Managing StyleCop Project Settings, http://stylecop.codeplex.com/wikipage?title=Managing%20StyleCop%20Project%20Settings&referringTitle=Documentation, there is a "Rules tab" link, http://stylecop.codeplex.com/wikipage?title=Rules%20tab&referringTitle=Managing%20StyleCop%20Project%20Settings.

On the Rules page under "Detailed Settings" the image shows "File headers".

Also, http://www.stylecop.com/docs/SA1633.html and http://www.stylecop.com/docs/SA1634.html, show that it should be possible. I suspect that under File Headers there will be an option or two for the above codes.

That allows for project level settings, however the docs further elude to allowing global settings - http://stylecop.codeplex.com/wikipage?title=Sharing%20StyleCop%20Settings%20Across%20Projects&referringTitle=Managing%20StyleCop%20Project%20Settings

like image 118
Jonathan Avatar answered Oct 23 '22 21:10

Jonathan