An override only calls the overridden function with the same arguments
What it finds
override fun start() = super.start() does what the inherited function does anyway. Overrides with annotations or with other modifiers than override and visibility are left out, as they may change how the member is seen.
From the rule's source, useless_override.rs.
class Child : Base() { override fun start() = super.start()tx0 reports: start only calls the function it overrides override fun stop(force: Boolean) {tx0 reports: stop only calls the function it overrides super.stop(force) } override fun pause(force: Boolean) { super.pause(!force) } override fun resume() { log("resume") super.resume() } @CallSuper override fun reset() = super.reset()} 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:override-only-calls-super" = "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:override-only-calls-super] reason="..."tx0 explain tx0/kotlin:override-only-calls-super shows the same in the terminal. Found a false positive? Report it.