Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ReSharper settings information #91

Merged
merged 3 commits into from
Jul 18, 2016
Merged

Update ReSharper settings information #91

merged 3 commits into from
Jul 18, 2016

Conversation

FantasticFiasco
Copy link
Collaborator

No description provided.

@FantasticFiasco
Copy link
Collaborator Author

I've added information on how to edit and save ReSharper settings. I am using ReSharper 2016.1.1 but guess the steps are the same for older versions.

Regarding the issue you had with using statements being added within the namespace and not at the top of the file, I assume that is due to the ReSharper setting add 'using' directive to the deepest scope in the C# Code Style section of the ReSharper configuration. You can read more about it on JetBrains webpage.

Since the team-shared configuration doesn't state that imported namespaces should be added to the deepest scope, I assume that you have a personal ReSharper settings file that overrides the team-shared. That would be a file named CUITe.sln.DotSettings.user. If existing, try to remove that file and see what happens.

@FantasticFiasco
Copy link
Collaborator Author

@icnocop Did the previous description solve your problem?

@FantasticFiasco
Copy link
Collaborator Author

Your name seems to pop up everywhere, I just saw it on Docker Toolbox.

Have you had time to look at the PR?

@icnocop
Copy link
Owner

icnocop commented May 16, 2016

Thank you for the pull request and your patience.

I will take a look in the next couple days, if not today.

I've updated my version of ReSharper to 2016 yesterday so I can test.

:)

@icnocop
Copy link
Owner

icnocop commented May 17, 2016

I opened CUITe.sln in Visual Studio 2013, went to ReSharper > Manage Options... > Solution "CUITe" team-shared > Add Layer > Open Settings File... > CUITe.sln.DotSettings:

cuite resharper 2

I then went into SearchConfigurator.cs and moved "using System;" to a deeper scope:

cuite resharper 1

But still no inspection warning; no light bulb on the left column, or warning symbol on the top right corner.

Solution "CUITe" personal Options:
cuite resharper 3 personal

Solution "CUITe" team-shared Options:
cuite resharper 4 team shared

This computer Options:
cuite resharper 5 this computer

ReSharper Code Inspection Settings:
cuite resharper 6 code inspection settings

ReSharper C# Code Style:
cuite resharper 6 c code style

@FantasticFiasco
Copy link
Collaborator Author

Clarification: ReSharper will not warn you when the using statements are inside the namespace (there doesn't seem to exist such a rule), but having add 'using' directive to the deepest scope unchecked, as you do in all layers of your settings, should prevent ReSharper to add them there if a using statement is missing and you use the ReSharper light bulb to fix the problem.

You can try that by removing using System; and let ReSharper fix the problem, both when add 'using' directive to the deepest scope is checked and unchecked.

To summarize, with the current configuration ReSharper will add missing using statements before the namespace is declared which is the behavior we want (I guess), but there is no way to configure ReSharper to warn if the using statement is within the namespace. I am sorry if I let you believe otherwise.

If everything else is to your satisfaction, tell me so and I'll merge the PR.

@icnocop
Copy link
Owner

icnocop commented May 24, 2016

Can we get StyleCop to provide a warning or error message about this non-conforming coding style?

@FantasticFiasco
Copy link
Collaborator Author

No I don't think so. We can give StyleCop a try if you wan't, my guess is that it supports this kind of configuration.

@icnocop
Copy link
Owner

icnocop commented Jun 8, 2016

StyleCop has rule SA1200 which we can use to enforce consistency within our code.

@FantasticFiasco
Copy link
Collaborator Author

Sorry, I misread your comment from May 24. I thought you where referring to ReSharper when I said I didn't think so. Yes, StyleCop can find these syntax problems. I have some experience with StyleCop Analyzers and we can incorporate that in CUITe. But I would like to do that in a separate PR if possible. Is that ok for you?

@icnocop
Copy link
Owner

icnocop commented Jul 11, 2016

Yes, I think StyleCop Analyzers is the way to go, and it can be in a separate PR. I think this PR can be merged if it still applies. StyleCop Analyzers requires Visual Studio 2015, so we should also upgrade the CUITe.sln file to open in Visual Studio 2015 by default. Thank you! :)

@FantasticFiasco FantasticFiasco merged commit 0554666 into icnocop:master Jul 18, 2016
@FantasticFiasco FantasticFiasco deleted the issue-88 branch July 18, 2016 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants