Hi all, with konsist is there a way to check unused imports ?
p
PoisonedYouth
08/21/2024, 5:47 AM
I think this is not the use-case of Konsist. Detekt has a rule for checking this.
t
twist
08/21/2024, 5:56 AM
I have not used detekt, can I as well write tests with detekt?
twist
08/21/2024, 5:59 AM
I just checked it it's a linter, Thank you!!
p
PoisonedYouth
08/21/2024, 6:02 AM
Detekt has a different approach and verifies your code against a set of rules during the build process. In case of unused imports a violation is reported and the build fails.
t
twist
08/21/2024, 6:05 AM
Thank you! I will set it up
m
Mitch Ware
08/21/2024, 12:45 PM
You might also find the Spotless gradle plugin valuable for this: it can be configured to remove unused imports, among other helpful code-formatting-type behaviors