KT.CASCADING_CALL_WRAPPING

Chained call is not placed on a new line when a preceding one is

Requires that all chained calls are placed on a new line if a preceding one is.

Noncompliant Code

Copy
foo()
.bar().baz()

Compliant Code

Copy
foo().bar().baz()
foo()
.bar()
.baz()

Options

  • includeElvis (default: True)

    require trailing elvis expressions to be wrapped on a new line

The content on this page is adapted from the Detekt Docs. Copyright ©2022 The Detekt Team. All rights reserved. https://detekt.dev/comments.html