tal
tal

Reputation: 409

Resharper: I would like to enforce project naming convention

using Resharper I would ike to enforce project, namespace and assembly name convension. Here are the rules:

How can I do it by configuring Resharper?

Thanks, Tal

Upvotes: 0

Views: 540

Answers (2)

Alexander Groß
Alexander Groß

Reputation: 10458

You need to specifiy the project's "root" namespace in the project settings Project | Properties | Application tab | Default namespace.

When MyUtilities.MyGreatString is set up ReSharper will put a squiggly line under each namespace that does not match this prefix. The "Namespace does not correspond to file location" inspection can be changed to a severity of "Error" to have namespace errors appear in the "Errors in Solution" window (given that you have solution-wide analysis enabled).

You can also right-click on the project or solution and select Refactor | Adjust namespaces to correct all namespaces in one go.

Upvotes: 2

Nilesh Gule
Nilesh Gule

Reputation: 1611

Not sure if resharper can do that out of the box for you. You could possibly look at other options which can do static or synamic code analysis. One option is to write a custom rule using something like Stylecop and integrate that with Resharper. there is alsready a stylecop plugin for resharper. Possibly the combination of custome rules and stylecop custom rule should help you achieve you objective.

Upvotes: 0

Related Questions