2023-05-03 11:06:20 +02:00
|
|
|
== Why is this an issue?
|
|
|
|
|
2023-06-06 17:27:22 +02:00
|
|
|
Shared naming conventions allow teams to collaborate efficiently.
|
2020-06-30 10:16:44 +02:00
|
|
|
|
2023-06-06 17:27:22 +02:00
|
|
|
This rule raises an issue when a method or a property name is not PascalCased.
|
|
|
|
|
|
|
|
For example, the method
|
2020-06-30 10:16:44 +02:00
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,csharp]
|
2020-06-30 10:16:44 +02:00
|
|
|
----
|
2023-06-06 17:27:22 +02:00
|
|
|
public int doSomething() {...} // Noncompliant
|
2020-06-30 10:16:44 +02:00
|
|
|
----
|
|
|
|
|
2023-06-06 17:27:22 +02:00
|
|
|
should be renamed to
|
2020-06-30 10:16:44 +02:00
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,csharp]
|
2020-06-30 10:16:44 +02:00
|
|
|
----
|
|
|
|
public int DoSomething() {...}
|
|
|
|
----
|
|
|
|
|
2023-05-03 11:06:20 +02:00
|
|
|
=== Exceptions
|
2020-06-30 10:16:44 +02:00
|
|
|
|
2023-06-06 17:27:22 +02:00
|
|
|
* The rule ignores members in types marked with `ComImportAttribute` or `InterfaceTypeAttribute`.
|
|
|
|
* The rule ignores `extern` methods.
|
|
|
|
* To reduce noise, two consecutive upper-case characters are allowed unless they form the full name. So, `MyXMethod` is compliant, but `XM` is not.
|
|
|
|
* The camel casing is not enforced when a name contains the ``++'_'++`` character.
|
2020-06-30 10:16:44 +02:00
|
|
|
|
2023-05-25 14:18:12 +02:00
|
|
|
[source,csharp]
|
2020-06-30 10:16:44 +02:00
|
|
|
----
|
2023-06-06 17:27:22 +02:00
|
|
|
void My_method_(){...} // Noncompliant, leading and trailing underscores are reported
|
|
|
|
|
|
|
|
void My_method(){...} // Compliant by exception
|
2020-06-30 10:16:44 +02:00
|
|
|
----
|
|
|
|
|
2023-05-03 11:06:20 +02:00
|
|
|
== Resources
|
2020-06-30 10:16:44 +02:00
|
|
|
|
2023-06-06 17:27:22 +02:00
|
|
|
=== Documentation
|
|
|
|
|
2020-06-30 10:16:44 +02:00
|
|
|
https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/capitalization-conventions[Microsoft Capitalization Conventions]
|
2021-06-02 20:44:38 +02:00
|
|
|
|
2021-06-03 09:05:38 +02:00
|
|
|
ifdef::env-github,rspecator-view[]
|
2021-09-20 15:38:42 +02:00
|
|
|
|
|
|
|
'''
|
|
|
|
== Implementation Specification
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../message.adoc[]
|
|
|
|
|
2021-06-08 15:52:13 +02:00
|
|
|
'''
|
2021-06-02 20:44:38 +02:00
|
|
|
== Comments And Links
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../comments-and-links.adoc[]
|
2023-06-22 10:38:01 +02:00
|
|
|
|
2021-06-03 09:05:38 +02:00
|
|
|
endif::env-github,rspecator-view[]
|