christophsturm
10/09/2023, 7:41 PMfun <T> autoClose(wrapped: T, closeFunction: suspend (T) -> Unit): T
I get these 3 errors:
> Task :failgood:lintKotlinMain FAILED
/Users/christoph/Projects/failgood/failgood/jvm/src/failgood/dsl/ResourcesDSL.kt:25:23: Lint error > [standard:function-signature] Newline expected after opening parenthesis
/Users/christoph/Projects/failgood/failgood/jvm/src/failgood/dsl/ResourcesDSL.kt:25:35: Lint error > [standard:function-signature] Parameter should start on a newline
/Users/christoph/Projects/failgood/failgood/jvm/src/failgood/dsl/ResourcesDSL.kt:25:69: Lint error > [standard:function-signature] Newline expected before closing parenthesis
the whole line is only 73 chars long.Paul Dingemans
10/11/2023, 7:13 PMktlint-official
code style, the function-signature
rules starts wrapping function signatures when the function contains 2 or more parameters regardless of line length. See documentation for configurationchristophsturm
10/12/2023, 12:53 PMchristophsturm
10/13/2023, 8:24 AMPaul Dingemans
10/13/2023, 8:35 AMktlint_official
goes beyond the style guides and puts more emphasis on consistency of code. By formatting all function signatures in a consistent way, maintenance becomes easier in my opinion. IntelliJ IDEA allows all following in same class/file:
fun foo1(a: String, b: String) = "foo"
fun foo2(
a: String, b: String
) = "foo"
fun foo3(
a: String,
b: String
) = "foo"
When working with multiple developers on the same project, or when maintain a long lived project, more and more variations of function signatures are introduced. This rules, restricts the number of variations by imposing stricter rules.christophsturm
10/13/2023, 9:11 AMPaul Dingemans
10/13/2023, 10:42 AM