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

Formatting class signature too long causes properties to indent too far in #2819

Closed
ZakTaccardi opened this issue Oct 1, 2024 · 1 comment

Comments

@ZakTaccardi
Copy link

ZakTaccardi commented Oct 1, 2024

Given this:

internal const val OS_USE_ONLY = "Public no-arg constructor is for Android OS use only."

internal open class ParentFragment

// line too long
internal class ChildFragmentTooooooooooooooooooooooooooooooooooooooooooooooLong @Deprecated(OS_USE_ONLY) constructor() : ParentFragment() {
    private val property = "some property"
}

When it's formatted

// formatted
internal class ChildFragmentTooooooooooooooooooooooooooooooooooooooooooooooLong @Deprecated(OS_USE_ONLY) constructor() :
    ParentFragment() {
        private val property = "some property"
}

the private val property = "some property" indents a further 4 spaces, which IMO is an undesired effect.

I'm actually not too sure how the above should be formatted, but I do know that it shouldn't affect the formatting of the rest of the class

Your Environment

  • Version of ktlint used: 1.3.1
@paul-dingemans
Copy link
Collaborator

Duplicate of #2423. Also see #2710 for related discussions.

@paul-dingemans paul-dingemans closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
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

2 participants