@Deprecated gives no ReplaceWith, so callers are not told what to use instead

tx0/kotlin:deprecated-without-replacementallwarningstyle/documentationdepth fastmaintainability

What it finds

@Deprecated("...", ReplaceWith("newName()")) lets the IDE rewrite the callers. Without it each caller has to work out the replacement from the message. Deprecations that hide a declaration with level = DeprecationLevel.HIDDEN are left out.

From the rule's source, deprecated_without_replacement.rs.

Example from the rule's tests
@Deprecated("Use start")tx0 reports: the deprecation does not say what to use insteadfun begin() {} @Deprecated("Use start", ReplaceWith("start()"))fun open() {} @Deprecated("Gone", level = DeprecationLevel.HIDDEN)fun old() {}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the all tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/kotlin:deprecated-without-replacement" = "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:deprecated-without-replacement] reason="..."

tx0 explain tx0/kotlin:deprecated-without-replacement shows the same in the terminal. Found a false positive? Report it.