do the detekt formatting rules use ktlint under th...
# detekt
e
do the detekt formatting rules use ktlint under the hood, or just attempt to reproduce ktlint’s behavior? I’m asking because I’m getting different indentation behavior between running detekt w/ auto correct enabled and manually running ktlint. Example:
Copy code
fun FooEntity.toWire(): Foo =
    Foo.newBuilder()
       .setLastSeenYearMonth(
            PartialDate.newBuilder()
                .setMonth(this.lastSeenMonth)
                .setYear(this.lastSeenYear)
                .build()
        )
        .build()
ktlint leaves that block as-is. detekt formats it like this:
Copy code
fun FooEntity.toWire(): Foo =
    Foo.newBuilder()
        .setLastSeenYearMonth(
        PartialDate.newBuilder()
            .setMonth(this.lastSeenMonth)
            .setYear(this.lastSeenYear)
            .build()
        )
        .build()
and then flags the indentation as wrong and increases the debt score.
Looks related: https://github.com/pinterest/ktlint/issues/1333 How can I update what version of ktlint detekt is using?
just force
com.pinterest.ktlint:ktlint-core
to a newer version in
dependencies
?
g
Yeah we do use KtLint under the hood
👍 1
e
it looks like i just needed to disable
ArgumentListWrapping
even w/ a newer version of the ktlint jars, it wasn’t quite right
👍 1