rspec/rules/S119/swift/rule.adoc

56 lines
770 B
Plaintext
Raw Permalink Normal View History

== Why is this an issue?
2020-06-30 10:16:44 +02:00
include::../description.adoc[]
=== Noncompliant code example
2020-06-30 10:16:44 +02:00
2021-01-27 13:42:22 +01:00
With the default regular expression ``++^[A-Z]$++``:
2022-02-04 17:28:24 +01:00
[source,swift]
2020-06-30 10:16:44 +02:00
----
public class MyClass<TYPE> { // Noncompliant
func method<TYPE>(t : TYPE) { // Noncompliant
}
}
----
=== Compliant solution
2020-06-30 10:16:44 +02:00
2022-02-04 17:28:24 +01:00
[source,swift]
2020-06-30 10:16:44 +02:00
----
public class MyClass<T> {
func method<T>(t : T) {
}
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
=== Parameters
.format
****
_String_
----
^[A-Z]$
----
Regular expression used to check the type parameter names against.
****
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]