Hey everyone đź‘‹,
Does anyone know of a complex example configuring KtLint/formatting for Detekt? I’m currently using KtLint only, and am interested on migrating (back) to Detekt and leveraging the KtLint support underneath.
đź‘€ 1
g
gammax
07/19/2021, 1:38 PM
It depends on what “complex example” means for you.
But this is applying ktlint separatelly, so not really helpful for using embedded ktlint in detekt
g
gammax
07/19/2021, 1:41 PM
The template has bot enabled, so you can simply remove the one you’re not interested (in your case
ktlint
).
s
simon.vergauwen
07/19/2021, 1:49 PM
I’m looking mostly to always enforce return types, not allow any star-imports.
And auto-formatting the codebase.
I’m not particularly attached to KtLint, but those are my most important rules.
Besides that I just follow the Official Kotlin Style Guide.
g
gammax
07/19/2021, 1:51 PM
I’m looking mostly to always enforce return types, not allow any star-imports.
Those are supported by Detekt first party rules IIRC (no need to use the ktlint wrapper).
And auto-formatting the codebase.
That’s not supported by detekt out of the box. You have to use