Ktlint documentation refers to this comment to explain why EOL comments on the same line as a value argument can result in problems.
However, the same problem occurs when the comments are placed on separate lines.
Before the refactoring:
data class Foo(val someParam1: Int, val someParam2: Int, val someParam3: List<String>)
val foo = Foo(
// some comment here about why 1
someParam1 = 10_000,
// some comment here about why 2
someParam2 = 100,
// some comment here about why 3
someParam3 = emptyList(),
)
After the "Change signature" refactoring:
data class Foo(val someParam1: Int, val someParam3: List<String>, val someParam2: Int)
val foo = Foo(
// some comment here about why 1
someParam1 = 10_000,
// some comment here about why 2
someParam3 = emptyList(),
// some comment here about why 3
someParam2 = 100,
)
Ktlint documentation refers to this comment to explain why EOL comments on the same line as a value argument can result in problems.
However, the same problem occurs when the comments are placed on separate lines.
Before the refactoring:
After the "Change signature" refactoring:
Originally posted by @YSakhno in https://github.com/pinterest/ktlint/issues/2445#issuecomment-1911159672