Why is this an issue?
Shared naming conventions allow teams to collaborate efficiently.
This rule raises an issue when a method or a property name is not PascalCased.
For example, the method
public int doSomething() {...} // Noncompliant
should be renamed to
public int DoSomething() {...}
Exceptions
- The rule ignores members in types marked with
ComImportAttributeorInterfaceTypeAttribute. - The rule ignores
externmethods. - To reduce noise, two consecutive upper-case characters are allowed unless they form the full name. So,
MyXMethodis compliant, butXMis not. - The camel casing is not enforced when a name contains the
'_'character.
void My_method_(){...} // Noncompliant, leading and trailing underscores are reported
void My_method(){...} // Compliant by exception
Allowing custom acronyms
You can configure the rule to ignore certain acronyms by adding a Microsoft Code Analysis
Dictionary as an AdditionalFiles item in your project:
<Dictionary>
<Acronyms>
<CasingExceptions>
<Acronym>SEO</Acronym>
<Acronym>IAC</Acronym>
</CasingExceptions>
</Acronyms>
</Dictionary>
<ItemGroup>
<AdditionalFiles Include="CustomDictionary.xml" />
</ItemGroup>