Skip to content
New issue

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

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

Already on GitHub? # to your account

Wrap annotations before class constructor (ktlint_official) #1916

Closed
paul-dingemans opened this issue Apr 5, 2023 · 0 comments · Fixed by #1920
Closed

Wrap annotations before class constructor (ktlint_official) #1916

paul-dingemans opened this issue Apr 5, 2023 · 0 comments · Fixed by #1920

Comments

@paul-dingemans
Copy link
Collaborator

Annotations before the class constructor should be wrapped in same way as other annotations when code style ktlint_official is used.

Example:

data class Foo @Bar1 @Bar2("bar") @Bar3 @Bar4 constructor(private val foobar: Int) {
    fun foo(): String = "foo"
}

should be formatted as

data class Foo
    @Bar1
    @Bar2("bar")
    @Bar3
    @Bar4
    constructor(private val foobar: Int) {
    fun foo(): String = "foo"
}
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant