Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump ktlint to 0.48.2 #6665

Merged
merged 4 commits into from Feb 17, 2023
Merged

Bump ktlint to 0.48.2 #6665

merged 4 commits into from Feb 17, 2023

Conversation

wmontwe
Copy link
Collaborator

@wmontwe wmontwe commented Feb 14, 2023

Fixed the issue with code style setup to allow update of ktlint 0.47.1 -> 0.48.2.

With ktlint 0.48.x, trailing-comma-on-call-site and trailing-comma-on-declaration-site rules have been enabled by default.

This previously caused failures when formatting the Kotlin source code.

With enabling ij_kotlin_allow_trailing_comma and ij_kotlin_allow_trailing_comma_on_call_site rules in .editorconfig and some small manual corrections, ktlint now properly formats.

Notable difference for enum classes:

  1. Last entry needs to be a trailing comma
  2. If enum class contains members, a semicolon needs to be placed on the next line (better git readability) This is sadly not supported by Intellij IDEA
enum class Type {
    TYPE_1,
    TYPE_2, <-- *1*
    ;   <-- *2*

    fun foo() { ... }
}

Also cleaned up remaining formatting issues for Kotlin sources.

@wmontwe wmontwe requested a review from cketti February 14, 2023 11:29
@wmontwe wmontwe force-pushed the bump_ktlint_to_0.48.2 branch 6 times, most recently from a682768 to 82cb622 Compare February 17, 2023 11:43
Copy link
Member

@cketti cketti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wmontwe wmontwe merged commit e0f0300 into main Feb 17, 2023
@wmontwe wmontwe deleted the bump_ktlint_to_0.48.2 branch February 17, 2023 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants