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

Annotation location on properties #409

Open
liutikas opened this issue Jul 7, 2023 · 1 comment
Open

Annotation location on properties #409

liutikas opened this issue Jul 7, 2023 · 1 comment
Labels
formatting-discussions Discussions about how formatting should look like, when there's no clear consensus.

Comments

@liutikas
Copy link

liutikas commented Jul 7, 2023

Let me start with I don't know if this is a bug or intentional behavior, but I would like to understand the reasoning behind this behavior.

Assume input:

@get:Rule
val benchmarkRule = BenchmarkRule()

this turns into when using --kotlinlang-style:

@get:Rule val benchmarkRule = BenchmarkRule()

What is the reasoning behind annotations being on the same line?

I see similar behavior on data classes

@Entity
data class EntityWithEnum(
    @PrimaryKey
    val id: Long,
    val fruit: Fruit
)

becomes

@Entity data class EntityWithEnum(@PrimaryKey val id: Long, val fruit: Fruit)

and it seems that putting the annotation on the same line makes it harder to read.

@greyhairredbear
Copy link
Contributor

This kind of formatting sometimes bugs me too... However, I don't expect changes anytime soon, see #226 and #395 for further reference. There is a workaround including comments - kind of ugly, but can help readability in some cases.

All that said, I think having consistent formatting outweighs the cost of the occasional style decision I personally don't agree with :)

@hick209 hick209 added the formatting-discussions Discussions about how formatting should look like, when there's no clear consensus. label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatting-discussions Discussions about how formatting should look like, when there's no clear consensus.
Projects
None yet
Development

No branches or pull requests

3 participants