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 with multiline type parameter #965

Closed
vRallev opened this issue Nov 17, 2020 · 1 comment · Fixed by #972
Closed

Wrong indent with multiline type parameter #965

vRallev opened this issue Nov 17, 2020 · 1 comment · Fixed by #972

Comments

@vRallev
Copy link

vRallev commented Nov 17, 2020

I assumed that it would be fixed by #951, but I tried the latest snapshot and still see some broken behavior.

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.

  private fun RenderTester<Boolean, OverviewCategoryRowState, OverviewCategoryRowOutput,
    OverviewCategoryRendering>.expectVisibilityWorker(
    expectedOutput: Boolean? = null
  ) = apply {
  }

Observed Behavior

KtLint complains about the indent in line 3 and 4:

Source.kt:3:5: Unexpected indentation (expected 6, actual 4)
Source.kt:4:3: Unexpected indentation (expected 4, actual 2)

If I change the code to what KtLint suggests, then the error changes

  private fun RenderTester<Boolean, OverviewCategoryRowState, OverviewCategoryRowOutput,
    OverviewCategoryRendering>.expectVisibilityWorker(
      expectedOutput: Boolean? = null
    ) = apply {
  }
Source.kt:3:1: Unexpected indentation (6) (should be 4)
Source.kt:4:1: Unexpected indentation (4) (should be 2)

Your Environment

  • Version of ktlint used: Latest snapshot from master 0.40.0
@cy6erGn0m
Copy link

Experiencing the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants