rspec/rules/S1186/vbnet/rule.adoc
Alban Auzeill 2c306d110e Fix code block ambiguity with old header style
Ensure blank line before list and clean the one leading space
2020-06-30 17:16:12 +02:00

36 lines
871 B
Plaintext

There are several reasons for a method not to have a method body:
* It is an unintentional omission, and should be fixed.
* It is not yet, or never will be, supported. In this case a <code>NotSupportedException</code> should be thrown.
* The method is an intentionally-blank override. In this case a nested comment should explain the reason for the blank override.
== Noncompliant Code Example
----
Sub DoSomething()
End Sub
Function DoSomething()
End Function
----
== Compliant Solution
----
Sub DoSomething()
' Not implemented because of reason
End Sub
Function DoSomething()
Throw New NotSupportedException
End Function
----
== Exceptions
The following methods are ignored:
* empty <code>Overridable</code> or <code>MustOverride</code> methods,
* empty methods that override an <code>MustOverride</code> method,
* empty overrides in test assemblies.