2023-05-03 11:06:20 +02:00
== Why is this an issue?
2023-06-08 08:03:28 +02:00
Shared naming conventions allow teams to collaborate efficiently.
2020-06-30 10:16:44 +02:00
2023-06-08 08:03:28 +02:00
This rule raises an issue when a type name is not PascalCased.
For example, the classes
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
----
class my_class {...}
class SOMEName42 {...}
----
2023-06-08 08:03:28 +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
----
class MyClass {...}
class SomeName42 {...}
----
2023-05-03 11:06:20 +02:00
=== Exceptions
2020-06-30 10:16:44 +02:00
2023-06-08 08:03:28 +02:00
* The rule ignores types marked with `ComImportAttribute` or `InterfaceTypeAttribute`.
* To reduce noise, two consecutive upper case characters are allowed unless they form the full type name. So, `MyXClass` is compliant, but `XC` is not.
* The rule allows having ``++'_'++`` characters in class names inside test projects: in that case, each word separated by ``++'_'++`` should be PascalCased.
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-08 08:03:28 +02:00
class Some_Name___42 {...} // Compliant in tests
class Some_name___42 {...} // Noncompliant
class Some_Name_XC {...} // Noncompliant because of XC, should be Some_Name_Xc
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-08 08:03:28 +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)
2023-05-25 14:18:12 +02:00
=== Message
* Rename [class|interface|struct] "XXX" to match PascalCase naming rules, consider using "Xxx".
* Rename [class|interface|struct] "XXX" to match PascalCase naming rules, trim underscores from the name.
2021-09-20 15:38:42 +02:00
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[]