parameter-list-wrapping
What it does
Section titled “What it does”Reports a parameter list that the formatter would wrap or join differently.
Why it matters
Section titled “Why it matters”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.
Example
Section titled “Example”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...Configuration
Section titled “Configuration”kotlin: lint: rules: parameter-list-wrapping: warn # off (default), warn, errorEnabled by the presets: kotlin/ktlint.
Suppress one line with sudsy-disable-next-line parameter-list-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 | parameter-list-wrapping |
full |