Releases: facebook/ktfmt
Releases · facebook/ktfmt
0.34
0.33
Formatting changes
- move comments between imports above import list: Instead of aborting due to comments in the middle of imports, Ktfmt will not move them in order to the top of the file
- Lambda indent assignment
- Fix formatting of block-like lambdas (+ scope functions) on long lines.
- Preserve semicolons between call expressions and dead lambdas.: This avoids cases that couldhave changed behavior.
Crash fixes
- Fix crash on annotated destructuring declaration element
- Fix crash when last superclass entry has a delegate
- Do not crash for 1 lambda argument with trailing comma
- Fix crash when type param has an annotation
- Always break get/set definitions onto lines below the property declaration.
0.32
0.31
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
- Fix crash when using optional arrow in lambda
- Fix crash when optional semicolon is used in a long single-line lambda
- Support
expect enum class
without a body.
Library changes
- Update kotlin version to 1.6.10
- When formatting stdin, print formatted code to stdout regardless of whether it changed
- Refactored namespace and function organization - for example,
format
was previously a top-level function, but now it's a method on theFormatter
object.
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)
0.30
0.29
0.28
0.27
0.26 (known bad)
UPDATE: This version has a severe bug
Changes:
- Fix explicit ctor formatting; and KDoc's ``` followed by more text (#238)
- Update ktfmt to fix odd formatting with DSLs. (#214)
- Fix for crash when formatting multiple annotations without
field:
prefix
Artifacts are available at Maven Central: https://search.maven.org/artifact/com.facebook/ktfmt/0.26/jar
0.25
ktfmt now uses Kotlin Compiler 1.5.0, though it doesn't necessarily handle all new language features.
Artifacts will be shortly available at Maven Central: https://search.maven.org/artifact/com.facebook/ktfmt/0.25/jar