0

My understanding is that running StyleCop as a ReSharper extension uses the Analyzer technology built into VS 2015 and, in this way, it differs from downloading and installing StyleCop as a standalone program. When I previously installed StyleCop as a standalone program, I had access to a StyleCop .Settings file that let me use the StyleCop dialog box for selecting certain options. Among those options was a Company Information tab, into which you can place Company Name and a Copyright notice: StyleCop Settings Documentation for the Company Information Tab

When ReSharper shows a StyleCop rule that needs attention and it has to do with adding a XML summary comment to the top of my class, ReSharper places the comment text for me. However, there is a space for Company Name and that value is always blank. This means that I must modify it manually, and that's tedious.

Question:

How do I tell ReSharper to populate the Company Name field with a certain value? Can I do that on a solution basis or does that Company Name field get defined globally?

Thank you.

1 Answer 1

1

If you're using StyleCop for ReSharper, it's actually using the same StyleCop parser that the command line uses, and not the VS2015 analyzers (unless you're actually using StyleCopAnalyzers). However, inserting comments and rewriting code is all ReSharper code. The plugin will still use your existing stylecop.settings files, and the company name comes from there. You can edit the file with the settings editor from the normal install of StyleCop.

Sign up to request clarification or add additional context in comments.

3 Comments

I had a fresh installation of VS 2015 Enterprise and ReSharper Ultimate 2016.1.2 before using the ReSharper extension manager to add StyleCop by JetBrains. After that install and a restart of VS, I see no such configuration option for StyleCop and no Settings file or settings-file editor. I see no entry for StyleCop in Visual Studio Tools | Options and only a StyleCop entry in ReShaper Tools | Options--with no reference to company name. Yet ReSharper is citing my code with StyleCop warnings... If I also need to install StyleCop, that seems unnecessary and unclear since rules are working.
You need to create a settings.stylecop file yourself. You can do this manually (it's just xml) or if you'd rather use the editor, then you can download and install the msi from codeplex. The editor can't ship with the resharper plugin, because there is no way to easily invoke it - double clicking the file will open the VS editor, and resharper extensions can't change the default app for a file.
Will try that and report back. Meanwhile, related enough (I hope) for you to comment: When having only ReSharper and the JetBrains StyleCop extension, I see you can ignore a StyleCop rule within a code document using the ReSharper hint, but how would you turn that rule back on? In other words, where is the master StyleCop rule list for the plugin (it doesn't appear to be in Analyzers or in the ReSharper options...).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.