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

Unexpected indentation for super type initialisation #731

Closed
gongdo opened this issue Dec 8, 2023 · 1 comment
Closed

Unexpected indentation for super type initialisation #731

gongdo opened this issue Dec 8, 2023 · 1 comment

Comments

@gongdo
Copy link

gongdo commented Dec 8, 2023

configuration

  • version: 12.0.2
  • IntellJ IDEA 2023.2.4
  • editor config
[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
max_line_length = 112
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true

[*.{kt,kts}]
indent_size = 4

code

sealed class Base(
    open val userId: String,
    open val message: String,
) {
    data class FooState(
        override val userId: String,
    ) : Base(
        userId = userId,
        message = "message",
    )
}

result

~8:1 Unexpected indentation (8) (should be 12)
~9:1 Unexpected indentation (8) (should be 12)
~10:1 Unexpected indentation (4) (should be 8)

expected behavior

The code above is perfectly fine in Kotlin code convention.
What did I do wrong in this configuration?

@gongdo
Copy link
Author

gongdo commented Dec 8, 2023

Nevermind. It seems like the same issue : pinterest/ktlint#2257

@gongdo gongdo closed this as completed Dec 8, 2023
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

No branches or pull requests

1 participant