JLLeitschuh / ktlint-gradle

A ktlint gradle plugin
MIT License
1.46k stars 160 forks source link

Unexpected indentation for super type initialisation #731

Closed gongdo closed 9 months ago

gongdo commented 9 months ago

configuration

[*.{kt,kts}] indent_size = 4


## code
```kotlin
sealed class Base(
    open val userId: String,
    open val message: String,
) {
    data class FooState(
        override val userId: String,
    ) : Base(
        userId = userId,
        message = "message",
    )
}

result

~8:1 Unexpected indentation (8) (should be 12)
~9:1 Unexpected indentation (8) (should be 12)
~10:1 Unexpected indentation (4) (should be 8)

expected behavior

The code above is perfectly fine in Kotlin code convention. What did I do wrong in this configuration?

gongdo commented 9 months ago

Nevermind. It seems like the same issue : https://github.com/pinterest/ktlint/issues/2257