Skip to content

newline-wrapping

Kotlinstyleno fixdefault: offkotlin/ktlint

Reports a bracket, comma or arrow where the formatter would break the line, or add a trailing comma.

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.

Reported
...
@Deprecated("x")
fun c() {}
fun d(x: Int,
y: Int) {
}
kotlin:
lint:
rules:
newline-wrapping: warn # off (default), warn, error

Enabled by the presets: kotlin/ktlint.

Suppress one line with sudsy-disable-next-line newline-wrapping in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
ktlint wrapping full