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

Enforce wrapped parameter styling. #130

Closed
JakeWharton opened this issue Dec 19, 2017 · 3 comments
Closed

Enforce wrapped parameter styling. #130

JakeWharton opened this issue Dec 19, 2017 · 3 comments

Comments

@JakeWharton
Copy link
Contributor

JakeWharton commented Dec 19, 2017

Both the JetBrains and Android style guide require

fun foo(
    bar: Bar,
    baz: Baz
) {

when the signature does not fit on one line.

Currently

fun foo(bar: Bar
        baz: Baz) {

is incorrectly marked valid (#26) which is not only incorrect but also encourages the bad practice of horizontally aligning things.

@shyiko
Copy link
Collaborator

shyiko commented Dec 19, 2017

Thank you for the ticket. We'll make sure this is fixed as part of #118.

@MyDogTom
Copy link
Contributor

These changes are included into IndentationRule and ClassAndFunctionHeaderFormatRule.
It's already possible to try them by using snapshot KtLint version - https://github.com/shyiko/ktlint#development
Alternatively, you can include https://github.com/MyDogTom/ktlint-custom-rules . This is just full copy of the IndentationRule and ClassAndFunctionHeaderFormatRule from ktlint:master.

I'm pretty sure, some cases are not handled, but it's almost impossible to find them without feedback from other people.

@shyiko
Copy link
Collaborator

shyiko commented Feb 27, 2018

Fixed in 0.16.0.

@shyiko shyiko closed this as completed Feb 27, 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

3 participants