Skip to content

parameter-list-wrapping

Kotlinstyleno fixdefault: offkotlin/ktlint

Reports a parameter list that the formatter would wrap or join differently.

A function with a long parameter list is laid out by a fixed rule, so that the layout does not depend on the author and a new parameter is one line in the diff.

To fix, run the formatter.

Reported
class A(val a: Int,
...
fun foo(a: Int, b: String, c: Long, d: Double, e: Float, f: Short, g: Byte, h: Char, i: Boolean, j: Unit): Int { return 1 }
...
1
...
kotlin:
lint:
rules:
parameter-list-wrapping: warn # off (default), warn, error

Enabled by the presets: kotlin/ktlint.

Suppress one line with sudsy-disable-next-line parameter-list-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 parameter-list-wrapping full