multiline-expression-wrapping
What it does
Section titled “What it does”Reports an expression that spans lines and starts after code on its line: the value of a property or a function body after =, or an argument.
Why it matters
Section titled “Why it matters”An expression that begins after val a = and goes on over several lines has its first line far from the left edge and the rest below, so the shape of the block is hard to read. A new line before it gives it a place of its own.
To fix, start the expression on the next line.
Example
Section titled “Example”...
fun baz() = run { 1 }
val x = listOf( 1,... )...Configuration
Section titled “Configuration”kotlin: lint: rules: multiline-expression-wrapping: warn # off (default), warn, errorEnabled by the presets: kotlin/ktlint.
Suppress one line with sudsy-disable-next-line multiline-expression-wrapping in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| ktlint | multiline-expression-wrapping |
full |