Skip to content

Formatting of annotations on return statements #497

@romainguy

Description

@romainguy

Original code:

@Suppress("AsCollectionCall")
return map.asMap()

After ktfmt:

@Suppress("AsCollectionCall") return map.asMap()

My issue with this is that it makes the return statement much harder to parse when reading code, especially if that statement isn't the last one in a method. This formatting makes sense for properties/variable declarations but a lot less for returns I think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions