ktlint

Developer ToolsMIT

An anti-bikeshedding Kotlin linter and formatter.

Latest 1.8.0 · by PinterestWritten in KotlinWebsitepinterest/ktlintRSS

Release activity

Release activity — 4 releases across 3 days in the last year. Each cell is one day; darker means more releases that day. Older weeks are hidden at this screen width.
JunJulAugSep
SundayNo releases on May 31, 2026No releases on Jun 7, 2026No releases on Jun 14, 2026No releases on Jun 21, 2026No releases on Jun 28, 2026No releases on Jul 5, 2026No releases on Jul 12, 2026No releases on Jul 19, 2026No releases on Jul 26, 2026No releases on Aug 2, 2026No releases on Aug 9, 2026No releases on Aug 16, 2026No releases on Aug 23, 2026No releases on Aug 30, 2026No releases on Sep 6, 2026No releases on Sep 13, 2026
MondayNo releases on Jun 1, 2026No releases on Jun 8, 2026No releases on Jun 15, 2026No releases on Jun 22, 2026No releases on Jun 29, 2026No releases on Jul 6, 2026No releases on Jul 13, 2026No releases on Jul 20, 2026No releases on Jul 27, 2026No releases on Aug 3, 2026No releases on Aug 10, 2026No releases on Aug 17, 2026No releases on Aug 24, 2026No releases on Aug 31, 2026No releases on Sep 7, 2026No releases on Sep 14, 2026
TuesdayNo releases on Jun 2, 2026No releases on Jun 9, 2026No releases on Jun 16, 2026No releases on Jun 23, 2026No releases on Jun 30, 2026No releases on Jul 7, 2026No releases on Jul 14, 2026No releases on Jul 21, 2026No releases on Jul 28, 2026No releases on Aug 4, 2026No releases on Aug 11, 2026No releases on Aug 18, 2026No releases on Aug 25, 2026No releases on Sep 1, 2026No releases on Sep 8, 2026
WednesdayNo releases on Jun 3, 2026No releases on Jun 10, 2026No releases on Jun 17, 2026No releases on Jun 24, 2026No releases on Jul 1, 2026No releases on Jul 8, 2026No releases on Jul 15, 2026No releases on Jul 22, 2026No releases on Jul 29, 2026No releases on Aug 5, 2026No releases on Aug 12, 2026No releases on Aug 19, 2026No releases on Aug 26, 2026No releases on Sep 2, 2026No releases on Sep 9, 2026
ThursdayNo releases on Jun 4, 2026No releases on Jun 11, 2026No releases on Jun 18, 2026No releases on Jun 25, 2026No releases on Jul 2, 2026No releases on Jul 9, 2026No releases on Jul 16, 2026No releases on Jul 23, 2026No releases on Jul 30, 2026No releases on Aug 6, 2026No releases on Aug 13, 20261 release on Aug 20, 2026No releases on Aug 27, 2026No releases on Sep 3, 2026No releases on Sep 10, 2026
FridayNo releases on Jun 5, 2026No releases on Jun 12, 2026No releases on Jun 19, 2026No releases on Jun 26, 2026No releases on Jul 3, 2026No releases on Jul 10, 2026No releases on Jul 17, 2026No releases on Jul 24, 2026No releases on Jul 31, 2026No releases on Aug 7, 2026No releases on Aug 14, 20262 releases on Aug 21, 2026No releases on Aug 28, 2026No releases on Sep 4, 2026No releases on Sep 11, 2026
SaturdayNo releases on Jun 6, 2026No releases on Jun 13, 2026No releases on Jun 20, 2026No releases on Jun 27, 2026No releases on Jul 4, 2026No releases on Jul 11, 2026No releases on Jul 18, 2026No releases on Jul 25, 2026No releases on Aug 1, 2026No releases on Aug 8, 2026No releases on Aug 15, 2026No releases on Aug 22, 2026No releases on Aug 29, 2026No releases on Sep 5, 2026No releases on Sep 12, 2026

4 releases in the last year, busiest day 2

Changelog

2.0.0-ALPHA-4

Pre-release
Added 7
  • Add RuleV2 to enforce autocorrect approve visitor
  • Add rule call-expression-wrapping and improve wrapping in chain-method-continuation and function-literal
  • Add blank line check between package and import statements
  • Add experimental rule lambda-return
  • Add experimental rules for blank lines between sections
  • Add GraalVM native-image binaries to release for Linux, macOS, and Windows
  • Add experimental rule no-blank-line-at-start-of-file
Changed 4
  • Change Maven coordinates from com.pinterest.ktlint to io.github.ktlint
  • Execute all rules on same AST Node before proceeding to next AST Node
  • Update Kotlin to v2.4.0 and set Java compilation to 26
  • Enable rule blank-line-before-declaration by default for android_studio
Fixed 8
  • Handle trailing comments on when entries in BlankLineBetweenWhenConditions
  • Keep no-unused-import as opt-in
  • Fix handling of EOL-comment in paren-spacing
  • Respect suppressions on ktlint:standard:max-line-length
  • Keep EOL comments on same line as when condition
  • Do not remove UTF BOM character
  • Do not wrap an annotated expression before a lambda expression
  • Fix writing formatted code containing a percent character provided via --stdin

From ktlint

IMPORTANT: This project is no longer maintained by Pinterest. As a result the Maven coordinates of the project have changed from com.pinterest.ktlint to io.github.ktlint. Read more in the documentation.

Note: Earlier alpha versions are not available as GitHub, nor as Maven Central download due to problems in fixing the release pipeline.

🆕 Features
  • Execute all rules on same AST Node before proceeding to next AST Node (possibly breaking change) - #3252, by @paul-dingemans
    Due to changing the order in which rules are executed, this is a potentially breaking change when rules are not well written. Normal rules only manipulate the AST for nodes that have not yet been visited. In case a rule for a given AST Node decides to manipulate an AST Node that already has been visited before, this might result in a failure.

  • Add RuleV2 to enforce autocorrect approve visitor - #3241, by @paul-dingemans

  • Add rule call-expression-wrapping, and improve wrapping in chain-method-continuation and function-literal - #3253, by @paul-dingemans

  • Add blank line check between package and import statements - #3266, by @maheen8q

  • Add experimental rule lambda-return - #3274, by @paul-dingemans

  • Update kotlin to v2.4.0 / set java compilation to 26 - #3316, by @paul-dingemans

  • Enable rule blank-line-before-declaration by default for android_studio - #3318, by @paul-dingemans

  • Add experimental rules for blank lines between sections - #3319, by @paul-dingemans

  • feat: add GraalVM native-image binaries to release (linux, macOS, Windows) - #3284, by @zeitlinger

  • Add experimental rule no-blank-line-at-start-of-file - #3361, by @paul-dingemans

🔧 Fixes
  • Handle trailing comments on when entries in BlankLineBetweenWhenConditions - #3177, by @jonapoul

  • Keep no-unused-import as opt-in - #3192, by @paul-dingemans

  • Fix handling of EOL-comment in paren-spacing - #3236, by @SubhrajyotiSen

  • Fix Square brackets spacing rule heading level - #3244, by @moon-dylan

  • Respect suppressions on "ktlint:standard:max-line-length" - #3255, by @paul-dingemans

  • Keep EOL comments on same line as when condition - #3261, by @paul-dingemans

  • Do not remove UTF BOM character - #3264, by @paul-dingemans

  • Do not wrap an annotated expression before a lambda expression - #3268, by @paul-dingemans

  • Fix writing formatted code containing a "%" character provided via --stdin - #3281, by @paul-dingemans

  • Do not join supertype with previous line when that line ends with and EOL comment - #3312, by @paul-dingemans

  • Prevent throwing a NullPointerException after fixing EOL comment by comment-spacing rule - #3314, by @paul-dingemans

  • Load .editorconfig correctly when --stdin-path is a relative path - #3322, by @paul-dingemans

  • Fix call expression wrapping when function literal has an empty multiline block body. - #3353, by @paul-dingemans

  • Fix output when reading input from stdin - #3359, by @paul-dingemans

  • fix(indent): support tabs before multiline where clauses - #3363, by @autaut03

  • Support positional name based destructuring - #3365, by @paul-dingemans

  • Rename context-receiver-list-wrapping to context-parameter-list-wrapping - #3367, by @paul-dingemans

📦 Dependencies
  • chore(deps): update ffurrer2/extract-release-notes action to v3 - #3196, by @renovate[bot]

  • fix(deps): update dependency org.ec4j.core:ec4j-core to v1.2.0 - #3197, by @renovate[bot]

  • fix(deps): update dependency com.github.ajalt.clikt:clikt to v5.1.0 - #3224, by @renovate[bot]

  • fix(deps): update dependency org.assertj:assertj-core to v3.27.7 - #3229, by @renovate[bot]

  • fix(deps): update dependency io.github.hakky54:logcaptor to v2.12.6 - #3273, by @renovate[bot]

  • chore(deps): update gradle/actions action to v6 - #3275, by @renovate[bot]

  • fix(deps): update dependency org.jetbrains.dokka:dokka-gradle-plugin to v2.2.0 - autoclosed - #3277, by @renovate[bot]

  • Update dependency io.github.detekt.sarif4k:sarif4k to v0.7.0 - #3285, by @renovate[bot]

  • Configure Renovate - #3304, by @renovate[bot]

  • Update softprops/action-gh-release action to v3 - #3283, by @renovate[bot]

  • Update dependency io.github.oshai:kotlin-logging-jvm to v8.0.4 - #3292, by @renovate[bot]

  • Update dependency org.slf4j:slf4j-simple to v2.0.18 - #3294, by @renovate[bot]

  • Update logback monorepo to v1.5.34 - #3310, by @renovate[bot]

  • Update dependency dev.drewhamilton.poko:poko-gradle-plugin to v0.23.1 - #3320, by @renovate[bot]

  • Update dependency com.vanniktech:gradle-maven-publish-plugin to v0.37.0 - #3327, by @renovate[bot]

  • Update plugin com.gradle.develocity to v4.5.0 - #3332, by @renovate[bot]

  • Update mislav/bump-homebrew-formula-action action to v4.2 - #3339, by @renovate[bot]

  • Update kotlin monorepo to v2.4.10 - #3340, by @renovate[bot]

  • Update plugin shadow to v9.6.1 - #3341, by @renovate[bot]

  • Update actions/setup-python action to v7 - #3342, by @renovate[bot]

  • Update actions/checkout action to v7 - #3347, by @renovate[bot]

  • Update Gradle to v9.7.0 - #3352, by @renovate[bot]

  • Update junit-framework monorepo to v6.1.3 - #3354, by @renovate[bot]

  • Update dependency ch.qos.logback:logback-classic to v1.6.3 - #3360, by @renovate[bot]

  • Override outdated log4j dependencies provided via logcaptor 2.12.6 - #3366, by @paul-dingemans

💬 Other
  • Avoid parallel uploads to Maven Central repository - #3194, by @paul-dingemans

  • Remove deprecated ConditionWrappingRule, and DiscouragedCommentLocationRule - #3237, by @paul-dingemans

  • Drop support for Java 8 and 11 - #3256, by @paul-dingemans

  • Remove deprecated methods which were marked for removal in Ktlint 2.0, and resolve TODO's - #3263, by @paul-dingemans

  • Update legal text to indicate this project is no longer maintained by Pinterest - #3297, by @shashachu

  • Update link to documentation in CLI help - #3311, by @Palleas

  • Migrate BCV - #3344, by @Goooler

  • Disable enableKotlinModuleRemapping for shadowJar - #3345, by @Goooler

  • Migrate "com.pinterest.ktlint" namespace to "io.github.ktlint.core" - #3348, by @paul-dingemans

  • Cleanup compilation warnings - #3368, by @paul-dingemans

View originalPermalink
How 2.0.0-ALPHA-4 went

2.0.0-ALPHA-3

Pre-release
Added 7
  • Add RuleV2 to enforce autocorrect approve visitor
  • Add rule call-expression-wrapping and improve wrapping in chain-method-continuation and function-literal
  • Add blank line check between package and import statements
  • Add experimental rule lambda-return
  • Add experimental rules for blank lines between sections
  • Add GraalVM native-image binaries to release for Linux, macOS, and Windows
  • Add experimental rule no-blank-line-at-start-of-file
Changed 3
  • Execute all rules on same AST Node before proceeding to next AST Node, which is a potentially breaking change for rules that manipulate already-visited AST nodes
  • Update Kotlin to v2.4.0 and set Java compilation to 26
  • Enable rule blank-line-before-declaration by default for android_studio
Fixed 10
  • Handle trailing comments on when entries in BlankLineBetweenWhenConditions
  • Keep no-unused-import as opt-in
  • Fix handling of EOL-comment in paren-spacing
  • Respect suppressions on ktlint:standard:max-line-length
  • Keep EOL comments on same line as when condition
  • Do not remove UTF BOM character

From ktlint

IMPORTANT: This project is no longer maintained by Pinterest. As a result the Maven coordinates of the project have changed from com.pinterest.ktlint to io.github.ktlint. Read more in the documentation.

Note: Earlier alpha versions are not available as GitHub, nor as Maven Central download due to problems in fixing the release pipeline.

🆕 Features
  • Execute all rules on same AST Node before proceeding to next AST Node (possibly breaking change) - #3252, by @paul-dingemans
    Due to changing the order in which rules are executed, this is a potentially breaking change when rules are not well written. Normal rules only manipulate the AST for nodes that have not yet been visited. In case a rule for a given AST Node decides to manipulate an AST Node that already has been visited before, this might result in a failure.

  • Add RuleV2 to enforce autocorrect approve visitor - #3241, by @paul-dingemans

  • Add rule call-expression-wrapping, and improve wrapping in chain-method-continuation and function-literal - #3253, by @paul-dingemans

  • Add blank line check between package and import statements - #3266, by @maheen8q

  • Add experimental rule lambda-return - #3274, by @paul-dingemans

  • Update kotlin to v2.4.0 / set java compilation to 26 - #3316, by @paul-dingemans

  • Enable rule blank-line-before-declaration by default for android_studio - #3318, by @paul-dingemans

  • Add experimental rules for blank lines between sections - #3319, by @paul-dingemans

  • feat: add GraalVM native-image binaries to release (linux, macOS, Windows) - #3284, by @zeitlinger

  • Add experimental rule no-blank-line-at-start-of-file - #3361, by @paul-dingemans

🔧 Fixes
  • Handle trailing comments on when entries in BlankLineBetweenWhenConditions - #3177, by @jonapoul

  • Keep no-unused-import as opt-in - #3192, by @paul-dingemans

  • Fix handling of EOL-comment in paren-spacing - #3236, by @SubhrajyotiSen

  • Fix Square brackets spacing rule heading level - #3244, by @moon-dylan

  • Respect suppressions on "ktlint:standard:max-line-length" - #3255, by @paul-dingemans

  • Keep EOL comments on same line as when condition - #3261, by @paul-dingemans

  • Do not remove UTF BOM character - #3264, by @paul-dingemans

  • Do not wrap an annotated expression before a lambda expression - #3268, by @paul-dingemans

  • Fix writing formatted code containing a "%" character provided via --stdin - #3281, by @paul-dingemans

  • Do not join supertype with previous line when that line ends with and EOL comment - #3312, by @paul-dingemans

  • Prevent throwing a NullPointerException after fixing EOL comment by comment-spacing rule - #3314, by @paul-dingemans

  • Load .editorconfig correctly when --stdin-path is a relative path - #3322, by @paul-dingemans

  • Fix call expression wrapping when function literal has an empty multiline block body. - #3353, by @paul-dingemans

  • Fix output when reading input from stdin - #3359, by @paul-dingemans

  • fix(indent): support tabs before multiline where clauses - #3363, by @autaut03

  • Support positional name based destructuring - #3365, by @paul-dingemans

  • Rename context-receiver-list-wrapping to context-parameter-list-wrapping - #3367, by @paul-dingemans

📦 Dependencies
  • chore(deps): update ffurrer2/extract-release-notes action to v3 - #3196, by @renovate[bot]

  • fix(deps): update dependency org.ec4j.core:ec4j-core to v1.2.0 - #3197, by @renovate[bot]

  • fix(deps): update dependency com.github.ajalt.clikt:clikt to v5.1.0 - #3224, by @renovate[bot]

  • fix(deps): update dependency org.assertj:assertj-core to v3.27.7 - #3229, by @renovate[bot]

  • fix(deps): update dependency io.github.hakky54:logcaptor to v2.12.6 - #3273, by @renovate[bot]

  • chore(deps): update gradle/actions action to v6 - #3275, by @renovate[bot]

  • fix(deps): update dependency org.jetbrains.dokka:dokka-gradle-plugin to v2.2.0 - autoclosed - #3277, by @renovate[bot]

  • Update dependency io.github.detekt.sarif4k:sarif4k to v0.7.0 - #3285, by @renovate[bot]

  • Configure Renovate - #3304, by @renovate[bot]

  • Update softprops/action-gh-release action to v3 - #3283, by @renovate[bot]

  • Update dependency io.github.oshai:kotlin-logging-jvm to v8.0.4 - #3292, by @renovate[bot]

  • Update dependency org.slf4j:slf4j-simple to v2.0.18 - #3294, by @renovate[bot]

  • Update logback monorepo to v1.5.34 - #3310, by @renovate[bot]

  • Update dependency dev.drewhamilton.poko:poko-gradle-plugin to v0.23.1 - #3320, by @renovate[bot]

  • Update dependency com.vanniktech:gradle-maven-publish-plugin to v0.37.0 - #3327, by @renovate[bot]

  • Update plugin com.gradle.develocity to v4.5.0 - #3332, by @renovate[bot]

  • Update mislav/bump-homebrew-formula-action action to v4.2 - #3339, by @renovate[bot]

  • Update kotlin monorepo to v2.4.10 - #3340, by @renovate[bot]

  • Update plugin shadow to v9.6.1 - #3341, by @renovate[bot]

  • Update actions/setup-python action to v7 - #3342, by @renovate[bot]

  • Update actions/checkout action to v7 - #3347, by @renovate[bot]

  • Update Gradle to v9.7.0 - #3352, by @renovate[bot]

  • Update junit-framework monorepo to v6.1.3 - #3354, by @renovate[bot]

  • Update dependency ch.qos.logback:logback-classic to v1.6.3 - #3360, by @renovate[bot]

  • Override outdated log4j dependencies provided via logcaptor 2.12.6 - #3366, by @paul-dingemans

💬 Other
  • Avoid parallel uploads to Maven Central repository - #3194, by @paul-dingemans

  • Remove deprecated ConditionWrappingRule, and DiscouragedCommentLocationRule - #3237, by @paul-dingemans

  • Drop support for Java 8 and 11 - #3256, by @paul-dingemans

  • Remove deprecated methods which were marked for removal in Ktlint 2.0, and resolve TODO's - #3263, by @paul-dingemans

  • Update legal text to indicate this project is no longer maintained by Pinterest - #3297, by @shashachu

  • Update link to documentation in CLI help - #3311, by @Palleas

  • Migrate BCV - #3344, by @Goooler

  • Disable enableKotlinModuleRemapping for shadowJar - #3345, by @Goooler

  • Migrate "com.pinterest.ktlint" namespace to "io.github.ktlint.core" - #3348, by @paul-dingemans

  • Cleanup compilation warnings - #3368, by @paul-dingemans

View originalPermalink
How 2.0.0-ALPHA-3 went

1.8.0

Latest
Added 6
  • Set languageVersion to KOTLIN_2_0 to ensure metadata compatibility with Kotlin 2.0
  • Simplify creation of a custom ruleset
  • Add rule then-spacing
  • Add CLI option --ignore-autocorrect-failures
  • Allow _ as backing property name
  • Promote experimental rules to standard rules: blank-line-between-when-conditions, kdoc, mixed-condition-operators, square-brackets-spacing, and when-entry-bracing
Fixed 1
  • Fix indent of function parameter with multiline expression in android_studio

From ktlint

🆕 Features
  • Set languageVersion to KOTLIN_2_0 to ensure metadata compatibility with Kotlin 2.0 - #3110, by @hugoncosta

  • Simplify creation of a custom ruleset - #3118, by @paul-dingemans

  • Add rule then-spacing - #3129, by @paul-dingemans

  • Add CLI option '--ignore-autocorrect-failures' - #3157, by @paul-dingemans

  • Allow _ as backing property name (needed for KEEP-412) - #3166, by @serras

  • Promote experimental rules to standard rules - #3171, by @paul-dingemans:

    • blank-line-between-when-conditions
    • kdoc
    • "mixed-condition-operators"
    • square-brackets-spacing
    • when-entry-bracing
🔧 Fixes
  • Fix link to maven wrapper - #3112, by @paul-dingemans

  • Fix links in documentation, and fix some typo's/formatting - #3127, by @paul-dingemans

  • Fix indent of function parameter with multiline expression in android_studio - #3131, by @paul-dingemans

  • fix(deps): update dependency com.vanniktech:gradle-maven-publish-plugin to v0.35.0 - #3169, by @renovate[bot]

💬 Other
  • Validate @SinceKtlint annotations with test and uniformize existing rules - #3101, by @hugoncosta

  • Fix snapshot repository location - #3106, by @paul-dingemans

  • Add code vulnerability scanning with CodeQL - #3113, by @paul-dingemans

  • Disable gradle build cache in code scanning workflow - #3116, by @paul-dingemans

  • Restrict access to GitHub token to "contents: read" - #3115, by @paul-dingemans

  • Change language for code-scanning workflow to 'kotlin' - #3117, by @paul-dingemans

  • Allow publication documents workflow to write to Github pages - #3121, by @paul-dingemans

  • Allow manual dispatch of workflow for publishing documentation - #3122, by @paul-dingemans

  • Set contents write permission on workflows for publishing documentation - #3123, by @paul-dingemans

  • Switch publication config to vanniktech's maven-publish plugin - #3068, by @mateuszkwiecinski

  • Add SECURITY.md file - #3114, by @paul-dingemans

  • Add public key to GitHub - #3139, by @shashachu

  • Ignore renovate updates for JUnit v6 as it requires Java17+ - #3146, by @paul-dingemans

View originalPermalink
How 1.8.0 went

1.7.1

Fixed 2
  • Make Ktlint code backwards compatible with lower Kotlin versions down to 2.0
  • Fix conflict between modifier-list-spacing and context-receiver-list-wrapping rules
Deprecated 1
  • Mark operand-expression-wrapping rule as experimental

From ktlint

🔧 Fixes
  • Make Ktlint code backwards compatible with lower Kotlin versions (down to 2.0) - #3063, by @mateuszkwiecinski
  • Fix conflict between modifier-list-spacing and context-receiver-list-wrapping - #3077, by @paul-dingemans
  • Mark operand-expression-wrapping rule as experimental - #3081, by @paul-dingemans
💬 Other
  • Update signing config, fix configuration-cache compatibility - #3058, by @mateuszkwiecinski
  • Refactor ShadowJarExecutableTask to KtlintCLiTask - #3078, by @paul-dingemans
View originalPermalink
How 1.7.1 went

1.7.0

Added 3
  • Add context-receiver-list-wrapping rule
  • Add context receiver list to modifier-order rule
  • Add experimental rule expression-operand-wrapping
Changed 3
  • Ignore context parameters in rule context-receiver-wrapping
  • Upgrade to Kotlin 2.2.0 with support for context parameters
  • Remove unneeded --add-opens=java.base/java.lang=ALL-UNNAMED parameter
Fixed 4
  • Do not remove an empty value parameter list from a call expression when it is nested
  • Clarify violation message in filename rule
  • Suppress warning sun.misc.Unsafe::objectFieldOffset in Ktlint CLI for Java 24+
  • Suppress error A restricted method in java.lang.System has been called on Java 24 in KtLint CLI
Removed 1
  • Do not run no-unused-imports rule by default
Deprecated 2
  • Deprecate functions in ASTNodeExtensions and provide property accessors instead
  • condition-wrapping rule no longer reports and fixes violations and will be removed in Ktlint 2.0

From ktlint

🆕 Features
Context receiver / parameters

With upgrade to Kotlin 2.2.0, Ktlint 1.7.0 supports context parameters.

  • Add context-receiver-list-wrapping rule - #3034, by @paul-dingemans

  • Add context receiver list to modifier-order rule - #3031, by @paul-dingemans

  • Ignore context parameters in rule context-receiver-wrapping - #3033, by @paul-dingemans

Other rule changes
  • Do not run no-unused-imports rule by default - #3039, by @paul-dingemans
    The no-unused-import rule is no longer run by default as it keeps causing problems. It will be removed in Ktlint 2.0. Until then, the rule can still be run, when enabled explicitly in .editorconfig.

  • Add experimental rule expression-operand-wrapping - #3056, by @paul-dingemans
    This rule aligns wrapping of arithmetic and logical multiline expressions. The condition-wrapping rule which did something similar for logical multiline expressions only no longer reports and fixes violations. It will be removed in Ktlint 2.0.

Other features
  • Deprecate functions in ASTNodeExtensions, and where applicable provide property accessors - #3026, by @paul-dingemans
    When using ASTNodeExtensions please replace function calls with the new (temporary) property accessors. The temporary property accessors are needed to maintain backwards compatability with Java integration. In Ktlint 2.0 the functions will be removed, and the temporary property accessors will be replaced with final names.

  • Suppress warning "sun.misc.Unsafe::objectFieldOffset" in Ktlint CLI (Java24+) - #3040, by @paul-dingemans

  • Suppress error "A restricted method in java.lang.System has been called" on Java 24 in KtLint CLI only - #3043, by @paul-dingemans

  • Remove unneeded "--add-opens=java.base/java.lang=ALL-UNNAMED" - #3044, by @paul-dingemans

🔧 Fixes
  • Do not remove an empty value parameter list from a call expression when it is nested - #3017, by @paul-dingemans

  • Clarify violation message in filename rule - #3046, by @paul-dingemans

📦 Dependencies
  • chore(deps): update plugin org.gradle.toolchains.foojay-resolver-convention to v1 - #2989, by @renovate[bot]

  • chore(deps): update plugin com.gradle.develocity to v4.0.2 - #2996, by @renovate[bot]

  • fix(deps): update junit5 monorepo - #3005, by @renovate[bot]

  • fix(deps): update dependency org.jetbrains.kotlin:kotlin-gradle-plugin to v2.2.0-rc3 - #3015, by @renovate[bot]

  • fix(deps): update dependency org.junit.jupiter:junit-jupiter to v5.13.2 - #3020, by @renovate[bot]

  • fix(deps): update dependency org.junit.platform:junit-platform-launcher to v1.13.2 - #3021, by @renovate[bot]

  • fix(deps): update kotlin monorepo to v2.2.0 - #3018, by @renovate[bot]

  • chore(deps): update plugin shadow to v8.3.8 - #3030, by @renovate[bot]

  • fix(deps): update junit-framework monorepo - #3037, by @renovate[bot]

  • chore(deps): update plugin kotlinx-binary-compatibiltiy-validator to v0.18.1 - #3050, by @renovate[bot]

  • fix(deps): update dependency dev.drewhamilton.poko:poko-gradle-plugin to v0.19.1 - #3053, by @renovate[bot]

  • fix(deps): update dependency com.google.jimfs:jimfs to v1.3.1 - #3054, by @renovate[bot]

  • chore(deps): update dependency gradle to v9.0.0-rc-2 - #3055, by @renovate[bot]

💬 Other
  • Update publishing URLs to point to Central Portal OSSRH staging API - #3006, by @shashachu

  • Update publishing credentials to use new Central Portal username/token - #3007, by @shashachu

  • Improve build - #3025, by @mateuszkwiecinski

  • Bump poko-gradle-plugin with a workaround (enforce compatible Kotlin version) - #3035, by @mateuszkwiecinski

  • Java 24 - #3049, by @paul-dingemans

  • Make build-logic plugins expose binary plugins - #3047, by @mateuszkwiecinski

  • Cleanup Java 24 bump - #3051, by @mateuszkwiecinski

View originalPermalink
How 1.7.0 went

1.6.0

Added 2
  • Add configuration option to handle certain annotation with parameters identical to annotations without parameters
  • Set system properties to prevent failure when running in ktlint-intellij-plugin with custom installation
Fixed 9
  • Fix incorrect error message in PropertyNamingRule when enforcing PascalCase
  • Sort RuleProvider declarations in StandardRuleSetProvider
  • Remove usages of getPsi()
  • Refactor KotlinPsiFileFactory to KotlinCompiler
  • Reduce the number of conversions between psi and ASTNode
  • Fix slow response of the git pre commit hook as generated by ktlint

From ktlint

🆕 Features
  • Add configuration option to handle (certain) annotation with parameters identical to annotations without parameters - #2950, by @paul-dingemans

  • Set system properties to prevent failure when running in ktlint-intellij-plugin with custom installation - #2970, by @paul-dingemans

🔧 Fixes
📦 Dependencies
  • fix(deps): update dependency org.jetbrains.dokka:dokka-gradle-plugin to v2 - #2906, by @renovate[bot]

  • chore(deps): update plugin kotlinx-binary-compatibiltiy-validator to v0.17.0 - #2907, by @renovate[bot]

  • Complete upgrade Dokka to V2 - #2914, by @paul-dingemans

  • fix(deps): update dependency ch.qos.logback:logback-classic to v1.3.15 - #2917, by @renovate[bot]

  • fix(deps): update dependency org.assertj:assertj-core to v3.27.3 - #2927, by @renovate[bot]

  • chore(deps): update plugin shadow to v8.3.6 - #2935, by @renovate[bot]

  • fix(deps): update dependency com.github.ajalt.clikt:clikt to v5.0.3 - #2938, by @renovate[bot]

  • fix(deps): update dependency org.slf4j:slf4j-simple to v2.0.17 - #2947, by @renovate[bot]

  • chore(deps): update plugin org.gradle.toolchains.foojay-resolver-convention to v0.10.0 - #2963, by @renovate[bot]

  • fix(deps): update dependency org.junit.jupiter:junit-jupiter to v5.12.2 - #2945, by @renovate[bot]

  • fix(deps): update dependency io.github.oshai:kotlin-logging-jvm to v7.0.7 - #2965, by @renovate[bot]

  • fix(deps): update dependency io.github.hakky54:logcaptor to v2.11.0 - #2968, by @renovate[bot]

  • chore(deps): update dependency gradle to v8.14 - #2971, by @renovate[bot]

  • chore(deps): update plugin com.gradle.develocity to v4.0.1 - #2972, by @renovate[bot]

  • fix(deps): update dependency org.jetbrains.kotlin:kotlin-gradle-plugin to v2.2.0-beta2 - #2977, by @renovate[bot]

  • fix(deps): update dependency org.ec4j.core:ec4j-core to v1.1.1 - #2987, by @renovate[bot]

  • fix(deps): update dependency dev.drewhamilton.poko:poko-gradle-plugin to v0.18.7 - #2986, by @renovate[bot]

  • fix(deps): update kotlin monorepo to 2.1.21 - #2985, by @renovate[bot]

💬 Other
  • ignore .kotlin directory - #2916, by @mgroth0
View originalPermalink
How 1.6.0 went

1.5.0

Added 3
  • Add missing space between `fun` keyword and identifier when latter is wrapped between backticks
  • Add configuration setting for constant names in `property-naming` rule
  • Allow backing property to be defined in the companion object in `backing-property-naming` rule
Changed 1
  • Update Kotlin to 2.1.0
Fixed 5
  • Ignore multi dollar string interpolation prefix in `string-template-indent` rule
  • Wrap the expression body in case `.editorconfig` property `ktlint_function_signature_body_expression_wrapping` is set to `always`
  • Fix false positive when empty parameter list is in between trailing lambda's of a nested call expression
  • Do not wrap a context receiver in a function parameter type reference
  • Allow comment before parameter list in function literal in `function-literal` rule

From ktlint

The release of Kotlin 2.1 is the primary reason for publishing this release earlier than planned. Because of the removal of some language elements in Kotlin 2.1, the embedded Kotlin compiler in KtLint blocked Kotlinter users from upgrading to Kotlin 2.1.

🆕 Features
  • Add missing space between fun keyword and identifier when latter is wrapped between backticks - #2890, by @paul-dingemans

  • Add configuration setting for constant names in property-naming rule - #2893, by @paul-dingemans

  • Allow backing property to be defined in the companion object (backing-property-naming) - #2895, by @paul-dingemans

🔧 Fixes
  • Ignore multi dollar string interpolation prefix in string-template-indent rule - #2888, by @paul-dingemans

  • Wrap the expression body in case .editorconfig property ktlint_function_signature_body_expression_wrapping is set to always - #2873, by @paul-dingemans

  • Fix false positive when empty parameter list is in between trailing lambda's of a nested call expression - #2891, by @paul-dingemans

  • Do not wrap a context receiver in a function parameter type reference - #2892, by @paul-dingemans

  • Allow comment before parameter list in function literal (function-literal) - #2894, by @paul-dingemans

📦 Dependencies
  • chore(deps): update plugin com.gradle.develocity to v3.18.2 - #2865, by @renovate[bot]

  • chore(deps): update dependency gradle to v8.11.1 - #2875, by @renovate[bot]

  • fix(deps): update dependency io.github.hakky54:logcaptor to v2.10.0 - #2874, by @renovate[bot]

  • fix(deps): update dependency org.jetbrains.kotlin:kotlin-gradle-plugin to v2.1.0-rc2 - #2871, by @renovate[bot]

  • fix(deps): update dependency io.github.oshai:kotlin-logging-jvm to v7.0.3 - #2883, by @renovate[bot]

  • fix(deps): update kotlin monorepo to v2.1.0 - #2880, by @renovate[bot]

  • fix(deps): update dependency com.github.ajalt.clikt:clikt to v5.0.2 - #2886, by @renovate[bot]

  • chore(deps): update plugin org.gradle.toolchains.foojay-resolver-convention to v0.9.0 - #2887, by @renovate[bot]

  • fix(deps): update dependency dev.drewhamilton.poko:poko-gradle-plugin to v0.18.0 - #2889, by @renovate[bot]

View originalPermalink
How 1.5.0 went

1.4.1

Changed 2
  • Update plugin shadow to v8.3.5
  • Update dependency org.jetbrains.kotlin:kotlin-gradle-plugin to v2.1.0-rc
Fixed 1
  • Catch java.lang.NoSuchFieldError when looking for WHEN_ENTRY_GUARD in kotlin version 2.0.1

From ktlint

🔧 Fixes
  • Catch java.lang.NoSuchFieldError when looking for WHEN_ENTRY_GUARD in kotlin version 2.0.1 - #2857, by @paul-dingemans
📦 Dependencies
  • chore(deps): update plugin shadow to v8.3.5 - #2851, by @renovate[bot]
  • fix(deps): update dependency org.jetbrains.kotlin:kotlin-gradle-plugin to v2.1.0-rc - #2853, by @renovate[bot]
View originalPermalink
How 1.4.1 went

1.4.0

Added 10
  • Suppress backing-property-naming on @Suppress("PropertyName")
  • Check that code can still be parsed after a format
  • Support suppressing backing-property-naming via ObjectPropertyName
  • Ignore properties starting with _ in backing-property-naming rule
  • Suppress backing-property-naming rule with @Suppress("LocalVariableName")
  • Do not repeat formatting if file is unchanged
Fixed 10
  • Prevent line separators to be changed from CRLF to LF
  • Do not remove arrow from lambdas that are when/if leaf nodes
  • Fix false positive in no-semi rule for enum class without enum entries
  • Prevent conflict between multiline-expression-wrapping and function-signature
  • Ignore max_line_length property unless max-line-length rule is enabled
  • Fix false positive in class-signature when EOL comment is between a class annotation and other class modifier

From ktlint

🆕 Features
  • Suppress backing-property-naming on @Suppress("PropertyName") - #2741, by @paul-dingemans

  • Check that code can still be parsed after a format - #2742, by @paul-dingemans

  • Support suppressing backing-property-naming via ObjectPropertyName - #2751, by @Goooler

  • Ignore properties starting with _ in backing-property-naming rule - #2753, by @paul-dingemans

  • Suppress backing-property-naming rule with @Suppress("LocalVariableName") - #2785, by @paul-dingemans

  • Do not repeat formatting if file is unchanged - #2805, by @paul-dingemans

  • Add new rule when-entry-bracing - #2829, by @paul-dingemans

  • Add .editorconfig property ij_kotlin_indent_before_arrow_on_new_line - #2838, by @paul-dingemans

  • Add CLI option --stdin-path to provide a virtual file location for stdin - #2836, by @adecker89

  • Add property .editorconfig property ktlint_enum_entry_name_casing - #2839, by @paul-dingemans

🔧 Fixes
  • Prevent line separators to be changed from CRLF to LF - #2752, by @paul-dingemans

  • fix: don't remove arrow from lambdas that are when/if leaf nodes - #2758, by @tKe

  • Fix false positive in no-semi rule for enum class without enum entries - #2774, by @paul-dingemans

  • Prevent conflict between multiline-expression-wrapping and function-signature - #2775, by @paul-dingemans

  • Ignore max_line_length property unless max-line-length rule is enabled - #2783, by @paul-dingemans

  • Fix false positive in class-signature when EOL comment is between a class annotation and other class modifier - #2786, by @paul-dingemans

  • Fix globs ending with ** - #2787, by @paul-dingemans

  • Return exit code 1 in case violations have been found but file is unchanged - #2803, by @paul-dingemans

  • Ignore missing whitespace after trailing comma in single line parameter value list - #2806, by @paul-dingemans

  • Remove HEADER_KEYWORD & IMPL_KEYWORD - #2810, by @3flex

  • Function signature rule ignores context receiver when on separate line - #2814, by @paul-dingemans

  • Do not remove imports for which the fully qualified path is identical to the package name - #2822, by @paul-dingemans

  • Fix indentation of a multiline parameter list inside a function literal for code style ktlint_official - #2823, by @paul-dingemans

  • Do not insert a trailing comma in a multiline when-entry containing a guard - #2825, by @paul-dingemans

  • Fix wrapping of expression body when max_line_length not set - #2833, by @paul-dingemans

📦 Dependencies
  • Update dependency io.github.oshai:kotlin-logging-jvm to v7 - #2701, by @renovate[bot]

  • Update dependency org.assertj:assertj-core to v3.26.3 - #2738, by @renovate[bot]

  • Update mikepenz/release-changelog-builder-action action to v5 - #2756, by @renovate[bot]

  • chore(deps): update plugin kotlinx-binary-compatibiltiy-validator to v0.16.3 - #2759, by @renovate[bot]

  • fix(deps): update dependency org.slf4j:slf4j-simple to v2.0.16 - #2764, by @renovate[bot]

  • Migrate to com.gradleup.shadow - #2763, by @Goooler

  • chore(deps): update gradle/actions action to v4 - #2760, by @renovate[bot]

  • chore(deps): update plugin com.gradle.develocity to v3.18.1 - #2792, by @renovate[bot]

  • chore(deps): update dependency gradle to v8.10.2 - #2812, by @renovate[bot]

  • chore(deps): update plugin shadow to v8.3.3 - #2820, by @renovate[bot]

  • fix(deps): update dependency com.github.ajalt.clikt:clikt to v5.0.1 - #2828, by @renovate[bot]

  • chore(deps): update kotlin monorepo to v2.0.21 - #2831, by @renovate[bot]

  • fix(deps): update dependency org.ec4j.core:ec4j-core to v1.1.0 - #2832, by @renovate[bot]

  • fix(deps): update dependency org.jetbrains.kotlin:kotlin-gradle-plugin to v2.1.0-beta2 - #2834, by @renovate[bot]

  • fix(deps): update dependency dev.drewhamilton.poko:poko-gradle-plugin to v0.17.2 - #2837, by @renovate[bot]

  • fix(deps): update dependency org.junit.jupiter:junit-jupiter to v5.11.3 - #2840, by @renovate[bot]

  • chore(deps): update actions/checkout digest to 11bd719 - #2841, by @renovate[bot]

View originalPermalink
How 1.4.0 went

1.3.1

Fixed 8
  • Do not insert a whitespace element as first or last child inside a composite element
  • Do not rewrite a class to a single line signature in case it contains an EOL comment
  • Fix false positive when anonymous function is used as value argument
  • Fix suppression handling when 'formatter:on' not properly specified
  • Fix false positive when primary constructor has no arguments and a secondary constructor exists
  • Ignore suppressions for no-unused-imports rule
  • Fix false alert 'Format was not able to resolve all violations which (theoretically) can be autocorrected'
  • Fix 'unset' value for property ktlint_chain_method_rule_force_multiline_when_chain_operator_count_greater_or_equal_than

From ktlint

🔧 Fixes
  • Add link for backing-property-naming, correct binary-expression-wrapping - #2704, by @rsmith20
  • Do not insert a whitespace element as first or last child inside a composite element - #2715, by @paul-dingemans
  • Do not rewrite a class to a single line signature in case it contains an EOL comment - #2716, by @paul-dingemans
  • Fix false positive when anonymous function is used as value argument - #2718, by @paul-dingemans
  • Fix suppression handling when 'formatter:on' not properly specified - #2719, by @paul-dingemans
  • Fix false positive when primary constructor has no arguments and a secondary constructor exists - #2717, by @paul-dingemans
  • Ignore suppressions for no-unused-imports rule - #2720, by @paul-dingemans
  • Ignore suppressions in rule no-unused-imports - #2725, by @paul-dingemans
  • Fix false alert Format was not able to resolve all violations which (theoretically) can be autocorrected - #2727, by @paul-dingemans
  • Fix "unset" value for property ktlint_chain_method_rule_force_multiline_when_chain_operator_count_greater_or_equal_than - #2728, by @paul-dingemans
📦 Dependencies
  • Update dependency gradle to v8.8 - #2680, by @renovate[bot]
  • Update plugin com.gradle.develocity to v3.17.5 - #2697, by @renovate[bot]
  • Update actions/checkout digest to 692973e - #2699, by @renovate[bot]
  • Update dependency io.github.hakky54:logcaptor to v2.9.3 - #2707, by @renovate[bot]
  • Update dependency org.junit.jupiter:junit-jupiter to v5.10.3 - #2721, by @renovate[bot]
💬 Other
  • Remove sdkman - #2693, by @paul-dingemans
View originalPermalink
How 1.3.1 went

1.3.0

Added 3
  • Support partial formatting
  • Suppress property-name rule for ObjectPropertyName or PrivatePropertyName
  • Let API Consumer decide whether a LintError has to be autocorrected or not
Changed 1
  • Promote experimental rules to non-experimental: backing-property-naming, binary-expression-wrapping, chain-method-continuation, class-signature, condition-wrapping, function-expression-body, function-literal, function-type-modifier-spacing, multiline-loop
Fixed 12
  • Do not wrap operation reference after multiline string template
  • Ignore max line length in case the line contains only a string template followed by a comma
  • Ignore nested reference expressions in chain-method-continuation
  • Prevent exception in binary-expression-wrapping rule
  • Do not merge opening quotes of multiline string template with single line function signature
  • Fix replacement of redundant curly braces

From ktlint

🆕 Features
🔧 Fixes
  • Do not wrap operation reference after multiline string template - #2591, by @paul-dingemans

  • Ignore max line length in case the line contains only a string template followed by a comma - #2598, by @paul-dingemans

  • Ignore nested reference expressions in chain-method-continuation - #2606, by @paul-dingemans

  • Prevent exception in binary-expression-wrapping rule - #2607, by @paul-dingemans

  • Do not merge opening quotes of multiline string template with (single line) function signature - #2609, by @paul-dingemans

  • Fix replacement of redundant curly braces - #2617, by @paul-dingemans

  • Set and reset Locale to pass test for non-english contributor. - #2622, by @Jaehwa-Noh

  • Fix unwanted whitespace between super class constructor and its argument list - #2630, by @tKe

  • Fix typo's - #2641, by @paul-dingemans

  • Handle trailing space on preceding line in call to lineLengthWithoutNewlinePrefix - #2644, by @paul-dingemans

  • Fix KDoc for RuleSetProviderV3 - #2645, by @gumimin

  • Fix not checking for spacing around binary operators inside unary expression - #2653, by @cflee

  • Fix blank line before declarations rule code example - #2657, by @k-taro56

  • Fixed [{ }] notation for issue #2675 - #2677, by @Jolanrensen

  • Simplify default properties loading - #2679, by @Goooler

📦 Dependencies
  • Update dependency org.jetbrains.dokka:dokka-gradle-plugin to v1.9.20 - #2590, by @renovate[bot]

  • Update softprops/action-gh-release action to v2 - #2600, by @renovate[bot]

  • Update dependency io.github.detekt.sarif4k:sarif4k to v0.6.0 - #2605, by @renovate[bot]

  • Update dependency gradle to v8.7 - #2616, by @renovate[bot]

  • Migrate to develocity plugin - #2625, by @Goooler

  • Update dependency org.slf4j:slf4j-simple to v2.0.13 - #2632, by @renovate[bot]

  • Update gradle/wrapper-validation-action action to v3 - #2633, by @renovate[bot]

  • Update dependency io.github.oshai:kotlin-logging-jvm to v6.0.9 - #2634, by @renovate[bot]

  • Update dependency com.github.ajalt.clikt:clikt to v4.4.0 - #2647, by @renovate[bot]

  • Update kotlin monorepo to v1.9.24 - #2649, by @renovate[bot]

  • Update plugin com.gradle.develocity to v3.17.4 - #2660, by @renovate[bot]

  • Update dependency dev.drewhamilton.poko:poko-gradle-plugin to v0.15.3 - #2662, by @renovate[bot]

  • Update actions/checkout digest to a5ac7e5 - #2664, by @renovate[bot]

  • Update dependency org.assertj:assertj-core to v3.26.0 - #2669, by @renovate[bot]

View originalPermalink
How 1.3.0 went

1.2.1

Fixed 3
  • Mark new rules as experimental
  • Fix null byte as default value for --pattern-from-stdin
  • Fix handling of --reporter CLI parameter

From ktlint

🆕 Features

None

🔧 Fixes
  • Mark new rules as experimental - #2579, by @paul-dingemans
  • Fix null byte as default value for "--pattern-from-stdin" - #2580, by @paul-dingemans
  • Fix handling of "--reporter" CLI parameter - #2581, by @paul-dingemans
View originalPermalink
How 1.2.1 went
View all

Discussion

If you publish ktlint, you can claim this product by proving you administer its repository.