David Kubecka
05/03/2024, 12:18 PMktlint_function_signature_body_expression_wrapping to multiline
(from the default) and I'm seeing enclosed diff. According to the docs I would expect that the original formatting complies to the multiline setting. ktlint version=1.2.1Paul Dingemans
05/03/2024, 2:15 PMDavid Kubecka
05/03/2024, 2:21 PMPaul Dingemans
05/03/2024, 2:34 PMDavid Kubecka
05/03/2024, 2:37 PMfun test(
param: X
) = getList().let {
it.converToMap()
}
Paul Dingemans
05/03/2024, 2:43 PMDavid Kubecka
05/03/2024, 2:46 PMPaul Dingemans
05/05/2024, 8:55 AMDavid Kubecka
05/05/2024, 5:17 PMPaul Dingemans
05/08/2024, 6:38 AMif (someCondition ||
someOtherCondition
) {
}
for which some users argue that it should have been written as:
if (
someCondition ||
someOtherCondition
) {
}
David Kubecka
05/08/2024, 3:43 PMPaul Dingemans
05/08/2024, 4:06 PMPerhaps my biggest problem with the current behaviour is that the expression "entry point" is visually on the same horizontal (or actually might be to the left in case of smaller indent) as the rest of the expression lines. I would rather always have the entry point horizontally aligned with the closing parenthesis - no exceptions.Please use code sample to clarify what you mean. English is not my first language, and I have the feeling that I miss important nuances which makes this discussion hard. If you prefer to use style below, then use
always
as value for ktlint_function_signature_body_expression_wrapping
fun test(
param: X
) =
getList().let {
it.converToMap()
}
David Kubecka
05/08/2024, 4:38 PMDavid Kubecka
05/08/2024, 4:42 PMIf you prefer to use style below, then useI never said so 🙂 I would still like simple oneliners to stay on a single line. I'm really just talking about the complex example as shown in the first post of this thread. AFAIK the closest expression of what I would want is "handle function signatures with explicit/implicit types the same", i.e. the same as the current implicit types.as value foralways
ktlint_function_signature_body_expression_wrapping