argument-list-wrapping
What it does
Section titled “What it does”Reports an argument list of a call that the Kotlin formatter would wrap or join differently: the arguments on one line when they fit, one per line when they do not.
Why it matters
Section titled “Why it matters”A call whose arguments are wrapped in a mixed way (two on the first line, the rest below, aligned to the bracket) is hard to scan and makes a diff show a change on every line when one argument is renamed. One layout for all lists lets the formatter apply it and keeps the diffs small.
To fix, run the formatter, which lays the list out.
Example
Section titled “Example”... } foo(); bar()... callTheFunction(argumentNumberOne, argumentNumberTwo, argumentNumberThree, argumentNumberFour, argumentNumberFive, argumentNumberSix, argumentNumberSeven)}Configuration
Section titled “Configuration”kotlin: lint: rules: argument-list-wrapping: warn # off (default), warn, errorEnabled by the presets: kotlin/ktlint.
Suppress one line with sudsy-disable-next-line argument-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 | argument-list-wrapping |
full |