rspec/rules/S1939/csharp/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

54 lines
1.1 KiB
Plaintext

== Why is this an issue?
An inheritance list entry is redundant if:
* It is ``++Object++`` - all classes extend ``++Object++`` implicitly.
* It is ``++int++`` for an ``++enum++``
* It is a base class of another listed inheritance.
Such redundant declarations should be removed because they needlessly clutter the code and can be confusing.
=== Noncompliant code example
[source,csharp]
----
public class MyClass : Object // Noncompliant
enum MyEnum : int // Noncompliant
----
=== Compliant solution
[source,csharp]
----
public class MyClass
enum MyEnum
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
"yyy" implements "xxx" so "xxx" can be removed from the inheritance list.
"Object" should not be explicitly extended.
"int" should not be explicitly used as the underlying type.
'''
== Comments And Links
(visible only on this page)
=== on 16 May 2016, 17:01:45 Ann Campbell wrote:
\[~tamas.vajk] messages should be directive, not statements of fact.
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]