newline-wrapping
What it does
Section titled “What it does”Reports a bracket, comma or arrow where the formatter would break the line, or add a trailing comma.
Why it matters
Section titled “Why it matters”A list that wraps in one place and not in another has a layout that depends on who wrote it. One rule for the line breaks, and the trailing comma of a wrapped list, makes it independent of the author.
To fix, run the formatter.
Example
Section titled “Example”...@Deprecated("x")fun c() {}
fun d(x: Int, y: Int) {}Configuration
Section titled “Configuration”kotlin: lint: rules: newline-wrapping: warn # off (default), warn, errorEnabled by the presets: kotlin/ktlint.
Suppress one line with sudsy-disable-next-line newline-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 | wrapping |
full |