rspec/rules/S1186/scala/rule.adoc

64 lines
1.1 KiB
Plaintext
Raw Normal View History

== Why is this an issue?
:operationName: method
include::../description.adoc[]
== How to fix it
=== Code examples
==== Noncompliant code example
[source,scala,diff-id=1,diff-type=noncompliant]
----
def shouldNotBeEmpty() = { // Noncompliant - method is empty
}
def notImplementedYet() = { // Noncompliant - method is empty
}
def willNeverBeImplemented() = { // Noncompliant - method is empty
}
def emptyOnPurpose() = { // Noncompliant - method is empty
}
----
==== Compliant solution
[source,scala,diff-id=1,diff-type=compliant]
----
def shouldNotBeEmpty() = {
doSomething()
}
def notImplementedYet() = {
throw new NotImplementedError()
}
def willNeverBeImplemented() = {
throw new UnsupportedOperationException()
}
def emptyOnPurpose() = {
// comment explaining why the method is empty
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]