2023-05-03 11:06:20 +02:00
|
|
|
== Why is this an issue?
|
|
|
|
|
2021-08-17 16:06:47 +02:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
2023-05-25 14:18:12 +02:00
|
|
|
=== Noncompliant code example
|
|
|
|
|
|
|
|
[source,kotlin]
|
|
|
|
----
|
|
|
|
package my.company
|
|
|
|
|
|
|
|
import kotlin.String // Noncompliant; "kotlin" classes are always implicitly imported
|
|
|
|
import my.company.SomeClass // Noncompliant; same-package files are always implicitly imported
|
|
|
|
import java.io.File // Noncompliant; "File" is not used
|
|
|
|
|
|
|
|
import my.company2.SomeType
|
|
|
|
|
|
|
|
class ExampleClass {
|
|
|
|
|
|
|
|
val someString = ""
|
|
|
|
val something = SomeType()
|
|
|
|
|
|
|
|
}
|
|
|
|
----
|
|
|
|
|
|
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
|
|
|
|
[source,kotlin]
|
|
|
|
----
|
|
|
|
package my.company
|
|
|
|
|
|
|
|
import java.io.File
|
|
|
|
import my.company2.SomeType
|
|
|
|
|
|
|
|
class ExampleClass {
|
|
|
|
|
|
|
|
val someString = ""
|
|
|
|
val something = SomeType()
|
|
|
|
lateinit var fileUsage: File
|
|
|
|
|
|
|
|
}
|
|
|
|
----
|
2021-08-17 16:06:47 +02:00
|
|
|
|
|
|
|
|
2023-05-03 11:06:20 +02:00
|
|
|
=== Exceptions
|
2021-08-17 16:06:47 +02:00
|
|
|
|
|
|
|
Imports for types mentioned in KDoc comments are ignored.
|
|
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
2021-09-20 15:38:42 +02:00
|
|
|
|
|
|
|
'''
|
|
|
|
== Implementation Specification
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../message.adoc[]
|
|
|
|
|
2021-08-17 16:06:47 +02:00
|
|
|
'''
|
|
|
|
== Comments And Links
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../comments-and-links.adoc[]
|
2023-06-22 10:38:01 +02:00
|
|
|
|
2021-08-17 16:06:47 +02:00
|
|
|
endif::env-github,rspecator-view[]
|