ktlint v0.13.0 Release Notes

Release Date: 2017-11-28 // over 6 years ago
  • ➕ Added

    • 👕 no-line-break-before-assignment (#105),
      chain-wrapping (#23) (when wrapping chained calls ., ?. and ?: should be placed on the next line),
      range-spacing (no spaces around range (..) operator) rules.
    • 🖨 --print-ast CLI option which can be used to dump AST of the file
      👕 (see README / Creating a ruleset / AST for more details)
    • 0️⃣ --color CLI option for colored output (where supported, e.g. --print-ast, default (plain) reporter, etc)

    🔄 Changed

    • .editorconfig property resolution.
      👕 An explicit [*.{kt,kts}] is not required anymore (ktlint looks for sections containing *.kt (or *.kts) and will fallback to [*] whenever property cannot be found elsewhere).
      Also, a search for .editorconfig will no longer stop on first (closest) .editorconfig (unless it contains root=true).
    • max-line-length rule to assume max_line_length=100 when ktlint --android ... is used
      💅 (per Android Kotlin Style Guide).
    • kotlin-compiler version to 1.2.0 (from 1.1.51).

    🛠 Fixed

    • 👕 no-empty-class-body auto-correction at the end of file (#109).
    • 👕 max-line-length rule when applied to KDoc (#112)
      (previously KDoc was subject to max-line-length even though regular comments were not).
    • Spacing around = in @annotation|s (op-spacing).
    • Spacing around generic type parameters of functions (e.g. fun <T>f(): T {} -> fun <T> f(): T {}).
    • 👕 no-consecutive-blank-lines not triggering at the end of file (when exactly 2 blank lines are present) (#108)
    • indent continuation_indent_size % indent_size != 0 case (#76)
    • indent rule skipping first parameter indentation check.
    • final-newline rule in the context of kotlin script.
    • Git hook (previously files containing space character (among others) in their names were ignored)
    • 👕 Exit code when file cannot be linted due to the invalid syntax or internal error.