
In some cases, the `rule.adoc` at root of a rule is never included anywhere and thus is dead code. It's a maintenance cost by itself, but also it misses opportunities to inline code that seems used by two documents when in fact only one document is actually rendered. And this missed opportunity, in turn, stops us from applying the correct language tag on the code samples.
56 lines
770 B
Plaintext
56 lines
770 B
Plaintext
== Why is this an issue?
|
|
|
|
include::../description.adoc[]
|
|
|
|
=== Noncompliant code example
|
|
|
|
With the default regular expression ``++^[A-Z]$++``:
|
|
|
|
[source,swift]
|
|
----
|
|
public class MyClass<TYPE> { // Noncompliant
|
|
func method<TYPE>(t : TYPE) { // Noncompliant
|
|
}
|
|
}
|
|
----
|
|
|
|
=== Compliant solution
|
|
|
|
[source,swift]
|
|
----
|
|
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[]
|