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

ktlint incorrectly thinks there should be a space between the lambda and its label #167

Closed
SUPERCILEX opened this issue Mar 4, 2018 · 3 comments

Comments

@SUPERCILEX
Copy link

See: https://kotlinlang.org/docs/reference/coding-conventions.html#lambda-formatting

And the code that breaks it:

private val shouldEjectBlock = block@{ (pathProgress ?: return@block false) >= 0.85 }
@shyiko
Copy link
Collaborator

shyiko commented Mar 4, 2018

Hi Alex.
Current behavior is consistent with Intellij built-it formatter (see #62 (comment)).
I'd say we hold off until either Intellij is updated to reflect the change or there is a way to configure Intellij built-it formatter not to put space between @ and {.

@SUPERCILEX
Copy link
Author

@shyiko That's no longer the case (with the 1.2.30 plugin at least), here's a screenshot of IntelliJ complaining:
image
And if I run the auto formatter, it attaches the @ with the bracket.

@shyiko
Copy link
Collaborator

shyiko commented Mar 4, 2018

Alright. In that case I'm merging #62 in and releasing 0.19.0. It should become available within ~30m.

P.S. Thanks for the PR, @aem!

@shyiko shyiko closed this as completed Mar 4, 2018
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