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

[WRONG_INDENTATION] false positive warning on functions without body #1451

Closed
WebTiger89 opened this issue Jul 14, 2022 · 2 comments · Fixed by #1443
Closed

[WRONG_INDENTATION] false positive warning on functions without body #1451

WebTiger89 opened this issue Jul 14, 2022 · 2 comments · Fixed by #1443
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@WebTiger89
Copy link

WebTiger89 commented Jul 14, 2022

I'm not sure if this case was already covered:

fun test(
    flag: Boolean,
): String =
    with(flag) {
        ""
    }

or

fun simpleFun() =
    "Wrong indentation"

When extendedIndentAfterOperators: true the above code get false positive warnings. If extendedIndentAfterOperators: false the warnings disappear but will appear for other pieces of code like:

fun test() {
    println("This is a long comment " +
            "that requires multiple lines.")
}
@WebTiger89 WebTiger89 added the bug Something isn't working label Jul 14, 2022
@0x6675636b796f75676974687562 0x6675636b796f75676974687562 added this to To Do in Urgent bugs via automation Jul 15, 2022
@0x6675636b796f75676974687562 0x6675636b796f75676974687562 changed the title [WRONG_INDENTATION] false positive warning on functions without body [WRONG_INDENTATION] false positive warning on functions without body Jul 15, 2022
@0x6675636b796f75676974687562
Copy link
Member

@WebTiger89, you're right indeed.

That's why, as of #1443, we've introduced two separate flags (extendedIndentAfterOperators for expressions and extendedIndentForExpressionBodies for expression-body functions), consistently with IDEA. The change will make it into the 1.2.2 release, or you can build and try the snapshot version yourself.

We're working to improve our compatibility with Kotlin style guide (as implemented by IDEA), see this wiki page for details.

I'm closing this issue as a duplicate of #1443.

If you believe this is not true, feel free to reopen.

@0x6675636b796f75676974687562
Copy link
Member

Duplicate of #1443

@0x6675636b796f75676974687562 0x6675636b796f75676974687562 marked this as a duplicate of #1443 Jul 15, 2022
@0x6675636b796f75676974687562 0x6675636b796f75676974687562 added duplicate This issue or pull request already exists and removed bug Something isn't working labels Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants