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

-a flag inconsistent with Android-style operator handling #746

Closed
kevin1e100 opened this issue May 21, 2020 · 1 comment
Closed

-a flag inconsistent with Android-style operator handling #746

kevin1e100 opened this issue May 21, 2020 · 1 comment

Comments

@kevin1e100
Copy link

Reference: https://developer.android.com/kotlin/style-guide#where_to_break

Expected Behavior

ktlint --format -a seemingly should break lines before operators like && to conform with Android's style guide. (Personally I like line breaks before operators better in general, FWIW, not just for Android style.)

Observed Behavior

Line breaks are inserted / moved after && regardless of -a

Steps to Reproduce

Run ktlint -a --format over input like this:

fun foo(a: Boolean, b: Boolean): Boolean {
    return a
        && b
}

ktlint -a will reformat this by placing && on the same line as a, even though this input is correctly formatted per Android style.

Your Environment

  • Version of ktlint used: 0.35
  • Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task): command line
  • Version of Gradle used (if applicable):
  • Operating System and version: Linux
  • Link to your project (if it's a public repository):
@kevin1e100
Copy link
Author

Apologies, I think this is a dup of #168. I'll see if this can be clarified in the Android style guide instead.

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

1 participant