Closed bellini-ea closed 3 years ago
Thank you for reporting. It appears to be a bug in the underlying ktlint engine: https://github.com/pinterest/ktlint/issues/937
I will watch the issue and incorporate a fix when available.
You may already be mitigating it this way, but a workaround is to suppress ktlint for that line of code: https://github.com/pinterest/ktlint#how-do-i-suppress-an-error-for-a-lineblockfile
In this case I think it's
/* ktlint-disable no-unused-imports */
import org.mockito.Mockito.`when` as mockWhen
/* ktlint-enable no-unused-imports */
Should be fixed in the latest
In a kotlin project, using 3.2.0 of this plugin, the following import is totally removed by the formatter cause build failures due to the deleted line. I have mitigated this so we can continue to use the formatter however it is not ideal.