You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fun foo() {
if ((hasName(name) || absenceIsNull(descriptor, index)) && (!json.configuration.coerceInputValues || !coerceInputValue(descriptor, index, name)))
return index
}
IntelliJ formats this as:
fun foo() {
if ((hasName(name) || absenceIsNull(
descriptor,
index
)) && (!json.configuration.coerceInputValues || !coerceInputValue(descriptor, index, name))
)
return index
}
Ktlint 0.48.2 formats it as:
fun foo() {
if ((hasName(name) || absenceIsNull(descriptor, index)) && (!json.configuration.coerceInputValues || !coerceInputValue(
descriptor,
index,
name
))) {
return index
}
}
Both are not optimal. First the binary expression should be split per part of the expression. It should ideally result in:
fun foo() {
if ((hasName(name) || absenceIsNull(descriptor, index)) &&
(!json.configuration.coerceInputValues || !coerceInputValue(descriptor, index, name))
) {
return index
}
}
The text was updated successfully, but these errors were encountered:
paul-dingemans
changed the title
Wrap binary expression before wrapping parameters of function call
Wrap binary expression before wrapping arguments of function call
May 22, 2023
Given code below with
max-line-length
set to140
:IntelliJ formats this as:
Ktlint
0.48.2
formats it as:Both are not optimal. First the binary expression should be split per part of the expression. It should ideally result in:
The text was updated successfully, but these errors were encountered: