Closed kay-horst closed 3 months ago
This was also reported here https://github.com/facebook/ktfmt/issues/490 and is supposedly fixed, but the fix is not released yet.
I'm hoping they release it soon, so that the IntelliJ plugin, gradle-ktfmt and ktfmt jar all result in the same formatting again.
Any news on a possible release for the mentioned fix? It's quite annoying to work around this.
Ah no, release failed :(
v0.52 is out now. Let us know if you still face the issues reported here
Also make sure that spotless is using the same version of ktfmt that you are using in your IDE
v0.52 is out now. Let us know if you still face the issues reported here
It works for me now: ktfmt 0.52, the IntelliJ plugin, and ktfmt-gradle 0.20.1 all produce the same result.
The plugin now adds commas after each last parameter of a method, if each parameter is on its own line:
class Foo(
private val value1: String,
private val value2: String,
private val value3: String,
private val value3: String
) {
becomes
class Foo(
private val value1: String,
private val value2: String,
private val value3: String,
private val value3: String,
) {
It was not the case before.
Is this standard behaviour?
@kay-horst it is as now it handles trailing lambdas for the kotlinlang style (see #442)
./gradlew spotlessapply
) => Formatting back to old (correct) stateSettings for the Spotless plugin:
The workaround mentioned in #486 did not work for me.