function-signature
What it does
Section titled “What it does”Reports a function whose signature (everything up to the body) the formatter would lay out differently: the parameters on one line or one per line, the return type, and where the body starts.
Why it matters
Section titled “Why it matters”A signature that is laid out the same way in the whole project is quick to scan, and when a parameter is added only one line changes.
To fix, run the formatter.
Example
Section titled “Example”... 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 }
fun baz() = run { 1 }
...Configuration
Section titled “Configuration”kotlin: lint: rules: function-signature: warn # off (default), warn, errorEnabled by the presets: kotlin/ktlint.
Suppress one line with sudsy-disable-next-line function-signature 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 | function-signature |
full |