Releases: facebook/ktfmt
Releases · facebook/ktfmt
0.43
- Support disabling import optimization from command line
- Miscellaneous fixes to the KDoc formatter (https://github.com/facebook/ktfmt/pull/372[)](https://github.com/facebook/ktfmt/commit/d400033dc2ceabd430d79316ab0c4780bcb27ab1)
- Fix indentation of initializer-like expressions with leading comments (#382)
0.42
Changes:
- A new kdoc formatting engine! we've integrated https://github.com/tnorbye/kdoc-formatter into ktfmt, which fixes several kdoc formatting bugs.
- Preserve indentation of trailing comments in comma-separated lists (#357)
0.41
- Force-break an indent qualified expression rooted on multiline strings
- Fix unneeded break following long multiline string (google style) (
if (cond) ; else x
no longer crashes- Array literals in annotations are now processed correctly
0.40
- Don't break before '>' in type arguments
- Fix some spacing issues with comma separated lists in --google-style (#…
- Add --stdin-name to specify a file name to use when printing message …
- Fix crashes on intersection types (e.g. Foo<A & B>) (#341)
- When there's a break in value arguments, also break in the lambda body
- Improve lambda indentation when value arguments are on multiple lines
- When there's a break in type arguments, also break in value arguments
- Break before '>' in type arguments when they don't fit on one line
0.39
0.38
Changes:
- Handle lambda destructuring declarations with explicit type
- Disabling grouping of fields after the first group in qualified expre…
- Add line breaks to lambdas after broken function arguments
- Fix breaking before is keyword causing illegal code
- For --google_style, break between ( and long condition expressions (#325)
0.37
0.36
Style change examples:
Before: (notice as
)
bitmapMemoryCacheParamsSupplier =
builder.bitmapMemoryCacheParamsSupplier
?: DefaultBitmapMemoryCacheParamsSupplier(
(checkNotNull(builder.context.getSystemService(Context.ACTIVITY_SERVICE)) as
ActivityManager))
After:
bitmapMemoryCacheParamsSupplier =
builder.bitmapMemoryCacheParamsSupplier
?: DefaultBitmapMemoryCacheParamsSupplier(
(checkNotNull(builder.context.getSystemService(Context.ACTIVITY_SERVICE))
as ActivityManager))
Before: (notice imports
)
importCleanUpCandidates =
importList
.imports
.filter { import ->
import.isValidImport &&
!import.isAllUnder &&
import.identifier != null &&
requireNotNull(import.identifier) !in OPERATORS &&
!COMPONENT_OPERATOR_REGEX.matches(import.identifier.orEmpty())
}
.toSet()
After:
importCleanUpCandidates =
importList.imports
.filter { import ->
import.isValidImport &&
!import.isAllUnder &&
import.identifier != null &&
requireNotNull(import.identifier) !in OPERATORS &&
!COMPONENT_OPERATOR_REGEX.matches(import.identifier.orEmpty())
}
.toSet()