An import is not used in the file
What it finds
An import whose name appears nowhere in the file, neither in code nor in a documentation link, does nothing and misleads readers about the file's dependencies. Imports of names that operators and delegates call by convention, such as getValue or plus, are left alone, and so are imports with *.
From the rule's source, unused_import.rs.
import java.io.Fileimport java.util.Datetx0 reports: java.util.Date is imported and not usedimport kotlin.properties.Delegates.getValueimport java.util.concurrent.*import kotlin.math.max as maximumimport kotlin.math.min as minimumtx0 reports: kotlin.math.min is imported and not usedimport java.time.Instant /** Uses [Instant] in documentation. */fun read(path: String) = File(path).readText().length + maximum(1, 2) Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/kotlin:unused-import" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/kotlin:unused-import] reason="..."tx0 explain tx0/kotlin:unused-import shows the same in the terminal. Found a false positive? Report it.