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

1

25

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?

Magician answered 19/2, 2015 at 16:17 Comment(5)
I can't verify this now as I'm on 9.1 and I'm thus not sure if it works but what if you go to ReSharper > Options > Code Editing > Code Cleanup and set Profile to use with silent cleanup to a profile that has the Update file header option deselected?Microphysics
Unfortunately ReSharper.StyleCop plugin is still not available for ReSharper 9.1Magician
That's true but I'm referring to ReSharper's own setting that is there in 9.0 as well.Microphysics
Can you explain how this is different to this?#8165925Anabiosis
It is possible because I've done it ... the problem for me is that ReSharper has so many damn settings related to this and places to set them that its a bit like vooodoo magic getting the right combination. I've got it done in one of my solutions and for the life of me cannot remember the combination. Hugely annoying.Lollop
R
1

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

Redmund answered 24/4, 2015 at 2:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.