Always, I have got the following message:
name 'byteProivder_LengthChanged' does not match 'Methods, properities and events'. Suggested name is 'ByteProviderLengthChanged'
Not even the VS generated method name could get away from this suggestion. For example FormXXX_Load
is adviced to change to FormXXXLoad
.
So what should I do? Should I follow the name suggestion or just keep the VS style? If I follow the name suggestion, how to configure the ReSharper and let it change the name automatically? If I do not follow the ReSharper way, how could I turn this name suggestion option off?
There is a simple way to disable ReSharper's inconsistent naming evaluation check for an entire file/class.
By adding the following comment to the top of the file/class, ReSharper will not evaluate the naming conventions when analyzing the file/class.
// ReSharper disable InconsistentNaming
For a code fragment, you can:
// ReSharper disable InconsistentNaming
private void btnCreate_Click(object sender, RoutedEventArgs e)
// ReSharper restore InconsistentNaming
{
//.....
}
List of suggested comments provided by ReSharper:
// ReSharper disable InconsistentNaming
// ReSharper restore InconsistentNaming
// ReSharper disable CodeCleanup
// ReSharper restore CodeCleanup
ReSharper's advice is (in most cases) useful, but sometimes it misses the target and can even be a bit annoying.
You have three solutions for this;
Edit the ReSharper's definitions to match your liking (this is possible by selecting "edit X rule settings" from the quick fix menu on the left)
Hide the annoying ReSharper message (either locally with a comment or globally by changing the settings for this type of message. Both are possible from the quick fix menu)
Ignore ReSharper's message when it's simply useless.
No matter what you choose, make sure your selection encapsulates your entire work (as well as your team's work if you're a part of one). For instance, in the case of option 3, make a list of situations where ReSharper is ignored.
Keeping your code consistent is vital to any project (be it small or large) and should be your first guideline when thinking about ReSharper.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With