Name Redistribution Exception for "iPhone"

Can I add an exception to the Resharper naming convention for a specific word? In particular, I would like to make the enum value "iPhone", although I usually prefer PascalCase for enum values.

I checked the Resharper naming style documentation , but did not see any way to add a custom exception. I also tried using a custom abbreviation list, but this only works for all caps.

+4
source share
1 answer

You cannot add an exception for a specific word, but there is some workaround.

With ReSharper, you can add multiple naming rules for a member. You can add a new rule for the "member enumeration" parameters and set the name prefix to "iPhone". With this setting, you can determine the value of renaming "iPhone." Please note that with this parameter you can also determine the renaming value of "iPhoneWithReallyCoolFeature", since it does not violate this rule.

Screenshot for settings:

enter image description here

Update:

If you don’t mind polluting your code, you can add

// ReSharper disable once InconsistentNaming 

in front of your member listing "iPhone."

+5
source

Source: https://habr.com/ru/post/1501942/


All Articles