Skip to content

Releases: pinterest/ktlint

0.40.0

04 Dec 20:50
765344a
Compare
Choose a tag to compare

[0.40.0] - 2020-12-04

Special thanks to t-kameyama for the huge number of bugfixes in this release!

Added

  • Initial implementation IDE integration via '.editorconfig' based on rules default values (#701)
  • CLI subcommand generateEditorConfig to generate '.editorconfig' content for Kotlin files (#701)
  • A new capability to generate baseline and run ktlint against it with --baseline cli option (#707)

Fixed

  • Do not report when semicolon is before annotation/comment/kdoc and lambda (#825)
  • Fix false positive when import directive has backticks and alias (#910)
  • @receiver annotations with parameters are not required to be on a separate line (#885)
  • Fix false positive "File annotations should be separated from file contents with a blank line" in kts files (#914)
  • Fix false positive Missing newline after "->" when when entry has a nested if/else block (#901)
  • Allow an inline block comment in argument-list-wrapping (#926)
  • Fix false positive for line-breaks inside lambdas in argument-list-wrapping (#861) (#870)
  • Fix wrong indentation inside an if-condition in argument-list-wrapping (#854) (#864)
  • Fix false positive for method after string template in argument-list-wrapping (#842) (#859)
  • Fix false positive when a comment is not between declarations in spacing-between-declarations-with-comments(#865)
  • Fix formatting with comments (multiline-if-else) (#944)
  • Do not insert unnecessary spacings inside multiline if-else condition (indent) (#871) (#900)
  • Correctly indent primary constructor parameters when class has multiline type parameter (parameter-list-wrapping) (#921) (#938)
  • Correctly indent property delegates (indent) (#939)
  • Fix false positive for semicolon between empty enum entry and member (no-semicolons) (#957)
  • Fix wrong indentation for class delegates (indent) (#960) (#963)
  • Fix wrong indentation in named arguments (indent) (#964)
  • Fix wrong indentation when a function has multiline type arguments (parameter-list-wrapping) (#965)
  • Fix false positive for spacing-between-declarations-with-annotations (#970)
  • Fix ParseException when an assigment contains comments (no-line-break-before-assignment) (#956)
  • Fix false positive when right brace is after a try-catch block (spacing-around-keyword) (#978)
  • Fix false positive for control flow with empty body (no-semicolons) (#955)
  • Fix incorrect indentation for multi-line call expressions in conditions (indent) (#959)
  • Fix false positive for trailing comma before right parentheses|bracket|angle (spacing-around-comma) (#975)
  • Fix ktlint CLI could skip checking some of explicetly passed files (#942)

Changed

  • 'import-ordering' now supports `.editorconfig' default value generation (#701)
  • Update Gradle to 6.7.1 version

0.39.0

14 Sep 20:40
cab38c4
Compare
Choose a tag to compare

Added

  • Add new applyToIDEA location for IDEA 2020.1.x and above on MacOs
  • Debug output: print loaded .editorconfig content
  • Extract argument-list-wrapping rule into experimental ruleset
  • Split annotation-spacing into separate experimental rule

Fixed

  • Do not enforce raw strings opening quote to be on a separate line (#711)
  • False negative with multiline type parameter list in function signature for parameter-list-wrapping(#680)
  • Alternative .editorconfig path is ignored on stdin input (#869)
  • False positive with semicolons before annotations/comments/kdoc (#825)
  • Do not report when string-template expression is a keyword (#883)
  • False positive for subclass imports in no-unused-imports (#845)
  • False positive for static java function imports in no-unused-imports (#872)
  • Missing signature for KtLint CLI artifact published to Github release (#895)
  • Crash in annotation rule (#868)
  • False-positive unused import violation (#902)

Changed

  • Ktlint object internal code cleanup
  • Deprecate some of public methods in Ktlint object that should not be exposed as public api
  • Update Kotlin to 1.4.10 version
  • Make RuleSet class open so it can be inherited

0.38.1

27 Aug 16:57
Compare
Choose a tag to compare

Minor release to support projects using mixed 1.3/1.4 Kotlin versions (e.g. Gradle plugins)

Changed

  • Compile with apiLevel = 1.3

0.38.0

21 Aug 21:28
73e1123
Compare
Choose a tag to compare

New release with Kotlin 1.4.0 support and several enhancements and bugfixes.

Added

  • Experimental SpacingAroundAngleBracketsRule (#769)
  • Checksum generation for executable Jar (#695)
  • Enable Gradle dependency verification
  • parameter-list-wrapping rule now also considers function arguments while wrapping (#620)
  • Publish snapshots built against kotlin development versions
  • Initial support for tab-based indentation (#128)

Fixed

  • Safe-called wrapped trailing lambdas indented correctly (#776)
  • provideDelegate imports are not marked as unused anymore (#669)
  • Set continuation indent to 4 in IDE integration codestyle (#775)
  • No empty lines between annotation and annotated target (#688)
  • Unused imports reported correctly (#526) (#405)
  • No false empty lines inserted in multiline if-else block (#793)
  • No-wildcard-imports properly handles custom infix function with asterisk (#799)
  • Do not require else to be in the same line of a right brace if the right brace is not part of the if statement (#756)
  • Brace-less if-else bodies starting with parens indented correctly (#829)
  • If-condition with multiline call expression inside indented correctly (#796)

Changed

  • Update Gradle to 6.6 version
  • Update ec4j to 0.2.2 version. Now it should report path to .editorconfig file on failed parsing
    and allow empty .editorconfig files.
  • Update Kotlin to 1.4.0 version (#830)

0.38.0 Alpha 1

18 Aug 01:10
a94b43f
Compare
Choose a tag to compare
0.38.0 Alpha 1 Pre-release
Pre-release

Alpha release built against Kotlin 1.4.

0.37.2

16 Jun 16:53
Compare
Choose a tag to compare

Minor release to fix further bugs in ImportOrderingRule.

Fixed

  • Imports with aliases no longer removed (#766)

0.37.1

08 Jun 22:17
f19c100
Compare
Choose a tag to compare

Minor release to fix some bugs in the 0.37.0 release.

Fixed

  • Invalid path exception error on Windows machines when loading properties from .editorconfig (#761)
  • Imports with as no longer removed (#761)
  • The contents of raw strings are no longer modified by the indent rule (#682)

0.37.0

03 Jun 05:18
02cfb32
Compare
Choose a tag to compare

Thank you to Tapchicoma and romtsn for all their hard work on this release!

Added

  • Gradle wrapper validation (#684)
  • Experimental SpacingAroundDoubleColon rule (#722)
  • Experimental SpacingBetweenDeclarationsWithCommentsRule and SpacingBetweenDeclarationsWithAnnotationsRule. Fixes (#721)
  • kotlin_imports_layout config for .editorconfig file so that import ordering is configurable. Fixes (#527)

Changed

  • Kotlin was updated to 1.3.70 version
  • Loading properties from .editorconfig was fully delegated to ec4j library. This fixes ability to override
    properties for specific files/directories (#742)
  • Promote experimental "indent" rule to standard one, old standard "indent" rule is removed
  • Functions to calculate line/column are now public so they can be used by 3rd party tools (#725)
  • AnnotationRule now handles file annotations as well (#714)

Fixed

  • Ignore keywords in KDoc comments (#671)
  • Allow multiple spaces in KDoc comments (#706)
  • Trailing comment no longer reported as incorrect indentation (#710)
  • Annotated function types no longer reported as an error (#737)
  • FinalNewlineRule no longer reports error for empty files (#723)
  • EOL comments will no longer cause AnnotationRule to report an error (#736)
  • Formatter will no longer break class declaration with trailing comment (#728)
  • Formatting for single line if/else statements (#174)
  • Exception in NoLineBreakBeforeAssignmentRule (#693)

Removed

  • Removed Maven; builds all run under Gradle (#445)
  • Old standard IndentRule

0.36.0

03 Dec 19:43
Compare
Choose a tag to compare

Added

  • HTML reporter (#641)
  • Experimental rule to lint enum entry names (#638)
  • @Suppress("RemoveCurlyBracesFromTemplate") now respected (#263)

Upgraded

  • Gradle version to 5.6.2 (#616)
  • Kotlin to 1.3.60 (#658)

Fixed

  • .git directory now discovered instead of hardcoded (#623)
  • Several bugs with the experimental annotation rule (#628) (#642) (#654) (#624)
  • Allow newline after lambda return type (#643)
  • Allow empty first line in a function that returns an anonymous object (#655)
  • Indentation with lambda argument (#627)
  • ktlint can now lint UTF-8 files with BOM (#630
  • Indentation with newline before return type (#663)
  • Build/tests on Windows (#640)
  • Allow whitespace after ( followed by a comment (#664)

0.35.0

13 Oct 06:39
2956522
Compare
Choose a tag to compare

Added

  • Support for specifying color for output via --color-name command line flag. (#585)
  • Support for custom rulesets and providers on Java 9+ (#573)

Deprecated

  • --apply-to-idea flag; use applyToIDEA subcommand instead (#554)
  • --apply-to-idea-project flag; use applyToIDEAProject subcommand instead (#593)
  • 0.0.0-SNAPSHOT builds; snapshot builds are now versioned, e.g. 0.35.0-SNAPSHOT (#588)
    • Note: When using the new snapshot builds, you may need to add an explicit dependency on kotlin-compiler-embeddable to your ruleset project.

Removed

  • Support for loading 3rd party rulesets via Maven (#566)

Upgraded

  • Kotlin version to 1.3.50 (#565) (#611)

Fixed

  • Bugs with spacing in experimental AnnotationRule (#552) (#601
  • Brackets would be removed from empty companion object (#600)
  • Bugs with experimental IndentationRule (#597) (#599)
  • Erroneous space between } and ] (#596)
  • Spacing around multiplication sign in lambdas (#598)
  • --version output with gradle-built JAR (#613)