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

Unexpected failure with single line else expression what appears to be correct formatting in 0.40 #1047

Closed
ZacSweers opened this issue Jan 5, 2021 · 0 comments · Fixed by #1059
Labels

Comments

@ZacSweers
Copy link

ZacSweers commented Jan 5, 2021

Expected Behavior

This is correctly formatted

Observed Behavior

It is reported as failure.

Steps to Reproduce

Pasting exactly as-is in source for details

  override fun getActionScope(channelId: String?, threadTs: String?, isReadOnly: Boolean): AppActionScope {
    return if (channelId.isNullOrEmpty()) {
      AppActionNoChannelScope
    } else if (isReadOnly) {
      if (threadTs.isNullOrEmpty()) AppActionReadOnlyChannelScope(channelId) else AppActionReadOnlyChannelThreadScope(
        channelId,
        threadTs
      // The next line if the line it doesn't like
      )
    } else {
      if (threadTs.isNullOrEmpty()) AppActionChannelScope(channelId) else AppActionThreadScope(
        channelId,
        threadTs
      )
    }
  }

This results in this error:

SlackGlobalActionsHelper.kt:112:7: Unexpected indentation (expected 8, actual 6)

Your Environment

  • Version of ktlint used: 0.40.0

This is our editorconfig:

[*.{kt,kts}]
indent_size=2
continuation_indent_size=2
disabled_rules=final-newline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants