Skip to content

0.31

Compare
Choose a tag to compare
@cgrushko cgrushko released this 03 Feb 15:28

Formatting changes

  • Improve argument indentation when a multi-line function is followed by a lambda.

Before:

someFunction(
    first = arg1,
    second = arg2)
    .also { print(it) }

After:

someFunction(
        first = arg1,
        second = arg2)
    .also { print(it) }
  • Put function invocations on the same line when the variable name is shorter or equal to the indentation size
    • This is not new, but is now done more uniformly.

Before:

user
    .modify()
    .commit()

After:

user.modify()
    .commit()

Crash fixes

Library changes

Library usage before:

import com.facebook.ktfmt.format.format

val formattedCode = format(options, code)

Library usage after:

import com.facebook.ktfmt.format.Formatter

val formattedCode = Formatter.format(options, code)