New rule: Unused kotlin extensions#440
Conversation
| import java.io.File | ||
|
|
||
| data class UnusedKaptPluginFinding( | ||
| data class UnusedPluginFinding( |
There was a problem hiding this comment.
Made this generic. Can be used with any unused Gradle plugin
There was a problem hiding this comment.
This is good!
The kapt-oriented stuff is just about the oldest code in the project, and largely unchanged. It doesn't quite fit the patterns of everything else, but it hasn't been bad enough for me to revisit it just yet.
At some point, I'm going to want to broaden the somewhat-dated KAPT checks to a more generic "code generation" scope which includes Anvil and KSP extensions.
So, this is a step in that direction. :)
e4576d2 to
d2b7985
Compare
d2b7985 to
2059703
Compare
|
The |
RBusarow
left a comment
There was a problem hiding this comment.
Thanks for this!
Don't forget that the legacy plugin also handles @Parcelize, which fortunately has a different namespace than the current version.
I added a check for that reference to the rule, and added a test to ensure that rule doesn't give a false positive for "unused" when that older annotation is referenced.
modulecheck-core/src/main/kotlin/modulecheck/core/rule/ModuleCheckRuleFactory.kt
Outdated
Show resolved
Hide resolved
|
Thanks. It is great that GitHub now allows you to push into forked repos when PR is open. This was a challenge in the past. The Parcelize is there but isn't that now a separate plugin? If synthetic imports are not used, this plugin should be removed. It should be replaced by Parcelize specific one |
|
The two plugins use different annotation classes for old: So it could technically still be auto-fixed by replacing the plugin, but it would also require updating the Kotlin source. |
|
I see. I did not know about the package name change. |
Kotlin Android Extensions are officially deprecated and will be completely removed as part of Kotlin 1.8
This new rule checks if it is unused and can be removed from a module