Expected Behavior
Input is valid. Class body is correctly indented. Final brace is aligned with class opener.
Maybe the SuperClass(primaryParam) { line indented, but not the whole body. IntelliJ also just does this one line indent.
Observed Behavior
internal abstract class MyClass internal constructor(primaryParam: ResourceFolderRepository) :
SuperClass(primaryParam) {
private val privateProperty: File = primaryProperty.resourceDir
fun doStuff() {
val file = privateProperty.resolve("foo")
}
}
Steps to Reproduce
ktlint "MyClass.kt" --format
internal abstract class MyClass internal constructor(primaryParam: ResourceFolderRepository) :
SuperClass(primaryParam) {
private val privateProperty: File = primaryProperty.resourceDir
fun doStuff() {
val file = privateProperty.resolve("foo")
}
}
Note: when I unwrap the first line:
internal abstract class MyClass internal constructor(primaryParam: ResourceFolderRepository) : SuperClass(primaryParam) {
the indentation does not change at all, neither with:
internal abstract class MyClass internal constructor(
primaryParam: ResourceFolderRepository
) : SuperClass(primaryParam) {
But this header also reproduces this issue:
internal abstract class MyClass internal constructor(primaryParam: ResourceFolderRepository)
: SuperClass(primaryParam) {
Your Environment
- Version of ktlint used: 1.0.1
- Relevant parts of the
.editorconfig settings: none
- Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task): ktlint CLI
- Version of Gradle used (if applicable): N/A
- Operating System and version: Windows 10
Expected Behavior
Input is valid. Class body is correctly indented. Final brace is aligned with class opener.
Maybe the
SuperClass(primaryParam) {line indented, but not the whole body. IntelliJ also just does this one line indent.Observed Behavior
Steps to Reproduce
ktlint "MyClass.kt" --formatNote: when I unwrap the first line:
the indentation does not change at all, neither with:
But this header also reproduces this issue:
Your Environment
.editorconfigsettings: none