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

parameter-list-wrapping expects wrong indentation in returning if-else condition #864

Closed
romtsn opened this issue Aug 27, 2020 · 1 comment · Fixed by #929
Closed

parameter-list-wrapping expects wrong indentation in returning if-else condition #864

romtsn opened this issue Aug 27, 2020 · 1 comment · Fixed by #929

Comments

@romtsn
Copy link
Collaborator

romtsn commented Aug 27, 2020

Expected Behavior

Expect this code to not cause any errors

fun function() {
    return if (listOfNotNull(
            param1,
            param2,
            param3
        ).isEmpty()
    ) {
        true
    } else {
        false
    }
}

Observed Behavior

...
Unexpected indentation (expected 8, actual 12) (parameter-list-wrapping) // arguments
Unexpected indentation (expected 4, actual 8) (parameter-list-wrapping) // last line

Steps to Reproduce

Try to run lint on the given example, in case of formatting - this gets reformatted wrongly, which then causes indent rule to fail

Your Environment

  • Version of ktlint used: 0.38.0
  • Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task): CLI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants