Skip to content

Latest commit

 

History

History
183 lines (123 loc) · 9.58 KB

File metadata and controls

183 lines (123 loc) · 9.58 KB

Changelog

All notable changes to the ktfmt project (starting on v0.51) should be documented in this file.

The format is based on Keep a Changelog.

[1.0.0 Unreleased]

Changed

  • All styles managing trailing commas now (#216, #442)

[Unreleased]

Added

  • Support partial formatting with --lines/--line and matching --offset/--length pairs, mirroring google-java-format's selected-range formatting flags.
  • Support selected-range formatting in the IntelliJ plugin.

Changed

  • Reduced overall number of allocations to improve formatting performance (~6-7%) (#620)
  • Reuse results of Parser.parse (#622)

Fixed

  • Support name-based destructuring declarations. (#629)

[0.63]

Added

  • Support ij_kotlin_indent_size in editorconfig. (#604)
  • Support for lists within quoted blocks in KDoc comments (https://github.com/facebook/ktfmt/commit/68fa1585b759ad4b12ca4802bccd297f6a33b0f3)
  • Fix ONLY_ADD trailing commas strategy causing lines over MAX_WIDTH length (#610)
  • Remove forced breaking of context function types (#613)
  • 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)
  • Add a FormattingOptions.Builder API for tools to avoid breaking ABI changes with new options. (#614)

[0.62]

Added

  • Support ij_kotlin_continuation_indent_size in editorconfig. (#600)
  • Add --quiet flag to suppress per-file formatting status output. (#558)

Fixed

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

[0.61]

Added

  • Support for Kotlin 2.3.0 explicit backing field (#580)

Fixed

  • Editorconfig not found for relative paths (#582)

[0.60]

Added

  • Support for else if guard conditions (#563)
  • 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)
  • ktfmt cli can pull formatting configs from editor config files (#570)
  • Strip leading UTF-8 BOM before formatting so ktfmt no longer errors on files starting with a BOM (#565)

[0.59]

Fixed

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

[0.58]

Changed

  • Updated ShadowJar to 9.0.2 (#555)

Fixed

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

[0.57]

Added

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

Changed

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

Removed

  • Removed mvn build scripts

Fixed

  • Corrected reference to jar in formatter website's command line instructions https://facebook.github.io/ktfmt/
  • Trailing comma on when cases (#376)
  • Update idea plugin name to avoid collision with google-java-format (#553)

[0.56]

Changed

[0.55]

Added

  • Support guard conditions (#530, #537)
  • --version option in CLI (#534)

Changed

Fixed

  • Support context parameters (#518, #536)
  • Indentation options in .editorconfig-default (#543)

[0.53]

Fixed

  • Comments respecting max line width (#511)
  • Exception while parsing property accessor on Kotlin 2.0.20-Beta2+ (#513)

Changed

[0.52]

Fixed

  • IntelliJ plugin crash (#501)
  • Ordering of @property and @param in KDoc (#498)
  • Annotation in return expressions (#497)

Changed

  • KotlinLang style also managing trailing commas (#216, #442)
  • Converted IntelliJ plugin to Kotlin (#502)

Added

  • More stability tests (#488)
  • Custom profile in plugin settings, mirroring Gradle/Maven plugins (#503)

[0.51]

Added

  • Created CHANGELOG.md
  • Added --help option to CLI (#477)

Changed

Fixed

Removed