Skip to content

Releases: Kotlin/ktfmt

0.65

Choose a tag to compare

@AbdullinAM AbdullinAM released this 07 Oct 13:04

Added

  • Support partial formatting with --lines/--line and matching --offset/--length pairs, mirroring google-java-format's selected-range formatting flags (#627) by @ZacSweers
  • Support selected-range formatting in the IntelliJ plugin (#627) by @ZacSweers
  • GraalVM native image support (#584) by @sgammon
  • Support val/var keywords in destructuring entries (#637) by @asapha
  • Use --stdin-name as the EditorConfig lookup path when formatting source from stdin (#670) by @ZacSweers

Changed

  • Trailing comma is now added when a single parameter is formatted onto its own line (#624) by @lwasyl
  • Migrated from com.facebook.ktfmt package to org.jetbrains.kotlinx.ktfmt
  • Use the file's extension to differentiate between scripts and regular files in the parser

Fixed

  • Fix non-idempotent formatting when a managed trailing comma pushes a line over MAX_WIDTH (e.g. a long qualified expression as the last argument of a call). The comma is now accounted for by re-running the layout, so the line is broken correctly on the first pass (#636) by @MathieuLorber
  • Fix non-idempotent formatting when max width breaks a scoping-function lambda with a chained call (e.g. runCatching { ... }.getOrNull()): the chained call now breaks onto its own line together with the lambda on the first pass (#649) by @lwasyl

Full Changelog: v0.64...v0.65

0.64

Choose a tag to compare

@hick209 hick209 released this 24 Jun 01:45

Changed

  • Reduced overall number of allocations to improve formatting performance (~6-7%) (#620) – @qwwdfsad
  • Reuse results of Parser.parse (#622) – @qwwdfsad
  • Fix trailing lambda with chained call indentation (#626) – @ptitjes
  • Refactor build scripts (#623) – @AbdullinAM
  • Switch in-repo formatting to simple local gradle task (#628) – @ZacSweers

Fixed

Huge thanks to all the contributors! 🎉

Full Changelog: v0.63...v0.64

0.63

Choose a tag to compare

@hick209 hick209 released this 26 May 18:59

Added

  • Support ij_kotlin_indent_size in editorconfig. (#604) – @Goooler
  • Support for lists within quoted blocks in KDoc comments (68fa158) – @hick209
  • Fix ONLY_ADD trailing commas strategy causing lines over MAX_WIDTH length (#610) – @lwasyl
  • Remove forced breaking of context function types (#613) – @kyay10
  • Preserve user-authored line breaks inside lambda bodies by default, rather than have ktfmt impose anything. This can be particularly useful for DSL syntax like Compose UI or Kotlin Gradle script. The behavior follows the FormattingOptions.preserveLambdaBreaks setting of the chosen style. (#614) – @ZacSweers
  • Add a FormattingOptions.Builder API for tools to avoid breaking ABI changes with new options. (#614) – @ZacSweers

Huge thanks to all the contributors! 🎉

Full Changelog: v0.62...v0.63

0.62

Choose a tag to compare

@hick209 hick209 released this 17 Mar 15:36

Added

  • Add --quiet flag to suppress per-file formatting status output (#603) – @Goooler
  • Support ij_kotlin_continuation_indent_size in editorconfig (#600) – @Goooler

Fixed

  • Dot-qualified scoping functions (e.g., scope.launch { }) now format as block-like expressions, consistent with non-qualified calls (#205) – @hick209
  • Lambda bodies in when branches no longer get extra indentation with Meta style (#222) – @hick209
  • Comments before &&/|| operators in chained binary expressions no longer strand the operator on its own line (#527) – @hick209
  • Backtick-escaped full-path imports are no longer incorrectly removed as unused (#532) – @hick209
  • Blank lines before lists and blockquotes in KDoc comments are now preserved (#561) – @hick209
  • Fenced code blocks inside KDoc list items are no longer erroneously reflowed into a single line (#572) – @hick209
  • Fixed IJ plugin Gradle build (#583) – @rock3r
  • Single-line comments in if expressions are now correctly indented (#591) – @cmwarrington
  • Idea Plugin not applying custom trailing commas management strategy (#593) – @tKe
  • Comments between a multiline string and .trimMargin()/.trimIndent() are no longer deleted during formatting (#597) – @hick209
  • maxCommentWidth now defaults to maxLineWidth instead of being capped at 72, so KDoc comments respect the configured line width (#594) – @hick209
  • Block comment formatting inside of lambda expressions (#602) – @hick209
  • Compatibility with Kotlin compiler v2.3.20 (CONTEXT_RECEIVER_LIST renamed to CONTEXT_PARAMETER_LIST, K1 API opt-in for KotlinCoreEnvironment.createForProduction) (#605) – @hick209

Huge thanks to all the contributors! 🎉
And big thanks to @cortinico, @strulovich and @cgrushko for the code reviews ✅

Full Changelog: v0.61...v0.62

0.61

Choose a tag to compare

@hick209 hick209 released this 30 Dec 19:03

Added

Fixed

  • Editorconfig not found for relative paths (#582) – @tKe

Huge thanks to all the contributors! 🎉

Full Changelog: v0.60...v0.61

0.60

Choose a tag to compare

@hick209 hick209 released this 17 Dec 21:29

Added

  • Support for else if guard conditions (#563) – @tKe
  • Explicit Kotlin import layout for the default and Google specific editorconfig files to match ktfmt's style. The same layout was already applied to the Kotlin Lang editorconfig (#571) – @vRallev
  • ktfmt cli can pull formatting configs from editor config files (#570) – @tKe
  • Strip leading UTF-8 BOM before formatting so ktfmt no longer errors on files starting with a BOM (#565) – @KaranPradhan266

Huge thanks to all the contributors! 🎉

Full Changelog: v0.59...v0.60

0.59

Choose a tag to compare

@hick209 hick209 released this 14 Oct 20:27

Fixed

  • Special format handling of multiline strings handling of first line and do not format string template expressions (#560) – @hick209
  • Do not remove semicolon after an unnamed empty companion object, if it isn't the last element (#557) – @cgrushko

Full Changelog: v0.58...v0.59

0.58

Choose a tag to compare

@hick209 hick209 released this 28 Aug 16:27

Changed

Fixed

  • Do not apply special format handling of multiline strings with template expressions in them (#556) – @hick209
  • Make sure that we handle nested expressions for special format handling of multiline strings (4b4c96c) – @hick209

Huge thanks to all the contributors! 🎉

Full Changelog: v0.57...v0.58

0.57

Choose a tag to compare

@hick209 hick209 released this 20 Aug 17:01

Added

  • TrailingCommaManagementStrategy.ONLY_ADD strategy that does not remove existing trailing commas (#461, #512, #514) – @hick209
  • Formatting of where clauses (#541) – @hick209
  • Special format handling of multiline strings with trimMargin() and trimIndent() (#389) – @hick209

Changed

  • FormattingOptions.manageTrailingCommas was replaced with FormattingOptions.trailingCommaManagementStrategy, which also added new TrailingCommaManagementStrategy.ONLY_ADD strategy (#461, #512, #514) – @hick209
  • All styles managing trailing commas by default now (#216, #442) – @hick209

Removed

Fixed

Huge thanks to all the contributors! 🎉

Full Changelog: v0.56...v0.57

0.56

Choose a tag to compare

@hick209 hick209 released this 25 Jun 20:33

Changed

Huge thanks to all the contributors! 🎉

Full Changelog: v0.55...v0.56