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 indent for multiline named arguments #964

Closed
vRallev opened this issue Nov 17, 2020 · 0 comments · Fixed by #966
Closed

Wrong indent for multiline named arguments #964

vRallev opened this issue Nov 17, 2020 · 0 comments · Fixed by #966

Comments

@vRallev
Copy link

vRallev commented Nov 17, 2020

If this is a duplicate of #918, then please close this issue.

Expected Behavior

This is how Android Studio formats the code. We use 2 space indent, but the result is the same for 4 space indent.

val appStartData = AppStartData(
  appTasks = myProcessInfo.appTasks,
  classLoaderInstantiatedElapsedUptimeMillis =
  Perfs.classLoaderInstantiatedUptimeMillis?.let { it - processStartUptimeMillis },
  applicationInstantiatedElapsedUptimeMillis =
  Perfs.applicationInstantiatedUptimeMillis?.let { it - processStartUptimeMillis }
)

Observed Behavior

KtLint formats the code like that:

val appStartData = AppStartData(
  appTasks = myProcessInfo.appTasks,
  classLoaderInstantiatedElapsedUptimeMillis =
    Perfs.classLoaderInstantiatedUptimeMillis?.let { it - processStartUptimeMillis },
  applicationInstantiatedElapsedUptimeMillis =
    Perfs.applicationInstantiatedUptimeMillis?.let { it - processStartUptimeMillis }
)

Your Environment

  • Version of ktlint used: Latest snapshot from master 0.40.0
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

Successfully merging a pull request may close this issue.

1 participant