Warnings about all methods that start with 'Get'

I recently upgraded to Resharper 2019.1 EAP 7 (from an earlier EAP version). Since then, every method that starts with 'Get' has a warning - e.g. on a method called "GetValue()" I get the warning "Name 'GetValue' does not match rule 'Methods'. Suggested name is 'Value'."

I don't think I've changed any of my settings (nor has anyone on my team). Did the default settings change? If so, how can I change them back so I don't get these warnings any more?

3 comments
Comment actions Permalink

Hello Craig!

 

Could you please check the Use auto-detected rules in Resharper | Options | Code editing | C# | Naming style and disable it?

Thank you.

0
Comment actions Permalink

Thanks, that seems to have fixed it.

FYI, when I first turned the setting off all the associated warnings still appeared in my list of "Errors/Warnings in Solution". I had to use the "reanalyze all" button to remove them.

0
Comment actions Permalink

Hi Angelina Elycheva...

Can you help to explain what's going on here? I too am seeing a suggestion to remove "Get" from method names. Indeed, the MS Guidelines linked to in the ReSharper documentation on the subject require "verbs or verb phrases". Removing Get should fail that test.

Can you help to clarify how auto-detected rules work and how it would come up with this suggestion? It would be very useful if RS could point to the examples in the solution it's drawing on; in this case it's likely that those should be refactored!

I'll note that the help page linked to by "Why is ReSharper Ultimate suggesting this" makes no mention of the auto-detected rules. That would be a helpful addition.

Thank you.

2

Please sign in to leave a comment.