rspec/rules/S1172/swift/rule.adoc

57 lines
833 B
Plaintext
Raw Normal View History

== Why is this an issue?
2020-06-30 12:47:33 +02:00
include::../description.adoc[]
=== Exceptions
Override methods are excluded.
2020-06-30 12:47:33 +02:00
2022-02-04 17:28:24 +01:00
[source,swift]
2020-06-30 12:47:33 +02:00
----
override doSomething(a: Int, b: Int) { // no issue reported on b
2020-06-30 12:47:33 +02:00
compute(a)
}
----
== How to fix it
2020-06-30 12:47:33 +02:00
include::../how-to-fix-it.adoc[]
=== Code examples
==== Noncompliant code example
[source,swift,diff-id=1,diff-type=noncompliant]
2020-06-30 12:47:33 +02:00
----
func doSomething(a: Int, b: Int) { // "b" is unused
2020-06-30 12:47:33 +02:00
compute(a)
}
----
==== Compliant solution
2020-06-30 12:47:33 +02:00
[source,swift,diff-id=1,diff-type=compliant]
2020-06-30 12:47:33 +02:00
----
void doSomething(a: Int) {
2020-06-30 12:47:33 +02:00
compute(a)
}
----
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[]