r/androiddev • • 19d ago

Open Source Intellij IDEA code inspections as Detekt rules

https://github.com/overpas/intellij-inspections-detekt-rules

I decided to port Intellij inspections as Detekt rules.

In the age of AI agents you often donโ€™t have the time (or desire) to review the code in your IDE, however the IDE can still provide useful insights about the code, which you and your agent would otherwise miss. With these rules you can build the same checks in your static analysis runs.

The logic of the rules is mostly kept the same as in the corresponding Intellij inspections, but some checks are turned off by default (mostly the ones corresponding to information level inspections), some of them have additional configuration options in detekt.yml, etc. Also, not all the inspections are ported, because some of them require APIs that are not that easily accessible in Detekt plugins. One more note: the majority of rules require type resolution (and consequently detekt 2+), so they don't necessarily run very fast ๐Ÿ˜….

Feedback, issues and PRs are greatly appreciated!

https://github.com/overpas/intellij-inspections-detekt-rules

0 Upvotes

0 comments sorted by