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

MissingNewLine triggered on builder chain like pattern #380

Closed
vanniktech opened this issue Apr 17, 2019 · 4 comments
Closed

MissingNewLine triggered on builder chain like pattern #380

vanniktech opened this issue Apr 17, 2019 · 4 comments

Comments

@vanniktech
Copy link
Contributor

When using the --experimental flag with ktlint 0.31.0 and the following configuration:

[*.{kt,kts}]
indent_size=2
max_line_length=200

the following code is flagged:

    val shareEvent = ShareEvent()
        .putMethod(event.method)
        .putContentName(event.contentName)
        .putContentType(event.contentType)

This is the output:

Missing newline after "="

My code is perfectly intended. I don't know why I'd want to have the ShareEvent() on its own line.

@vanniktech
Copy link
Contributor Author

Similar is also:

    BuyCustomThemeInteractor(MockRxBilling(
        getPurchasedInApp = Observable.error(exception)
    ), analytics)

Where it's complaining about Missing newline before ")" which refers to the last closing parenthesis.

@shashachu
Copy link
Contributor

I think your first bug is the same one as this one #368 - i didn't know how to describe it properly, but an assignment followed by some other statements seems to trigger it.

@shashachu
Copy link
Contributor

@vanniktech I'm going to close this one since it's a dupe of #368 - feel free to open a separate ticket for the parentheses case. I'm not sure yet whether these all have the same root cause or not.

@vanniktech
Copy link
Contributor Author

Thanks. Once that other issue has a PR / fix, I can try it out again.

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