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

No newline after arrow when the expression is one-line #597

Merged

Conversation

yukukotani
Copy link
Contributor

Fixes #586

Do not insert newline after arrow, when following expression is one-line.

Current

fun test(status: A): B {
    return when (status) {
        A.A,
        // Missing newline after "->"
        A.B -> B.A
    }
}

// Formatted
fun test(status: A): B? {
    return when (status) {
        A.A,
        A.B ->
            B.A
    }
}

Patched

fun test(status: A): B {
    return when (status) {
        A.A,
        //  No error
        A.B -> B.A
    }
}

Copy link
Collaborator

@Tapchicoma Tapchicoma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution 👍

@Tapchicoma Tapchicoma merged commit 86672c1 into pinterest:master Oct 3, 2019
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

Successfully merging this pull request may close these issues.

Redundant newline after ->
2 participants