I've installed detekt plugin into IDEA, how to use...
# detekt
v
I've installed detekt plugin into IDEA, how to use it?
j
You need to enable it, search project configuration for detekt
Just for heads up, unfortunately at least for me it only works with default config, there is an option to provide custom config but if I do that checks no longer work at all. I've reported this in plugins Github issues
v
Wow, I've enabled it. It just highlighted the whole class with yellow, 'cause of no doc-comments
j
Yes, it's using default rules
v
Ouch, I just want one simple thing -- check code style
j
Also the plugin has other pitfall, ktlint rules are in separate module called "detekt formatting" which cannot be configured for IDEA plugin currently :(
v
Why not just disable that documentation check by default? It's just impossible to work. In my case documentation is not needed yet, 'cause I'll explain code line-by-line in the report
t
you can just activate ktlint rules without any plugin
either via
ktlint
jar directly or via
ktlint-gradle
gradle plugin
v
@tapchicoma do you mean enabling it in Settings -> Editor -> Inspections? Are those
ktlint
rules?
t
I mean by downloading ktlint: https://github.com/shyiko/ktlint/releases/download/0.29.0/ktlint and running either
./ktlint --apply-to-idea
or
./ktlint --apply-to-idea-project
. Also this Gradle plugin: https://github.com/JLLeitschuh/ktlint-gradle adds tasks that do the same.
v
Got it, thanks