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
Given code below, then multiple runs of ktlint are needed to replace all function bodies with body expressions:
fun foo1(): String {
return "42"
}
fun foo2(): String {
return "42"
}
fun foo3(): String {
return "42"
}
fun foo4(): String {
return "42"
}
fun foo5(): String {
return "42"
}
Note that after first run of ktlint command, up to 3 function bodies are replaced, as ktlint will automatically run 3 times in case format violations have been fixed. Output after first run:
fun foo1(): String {
return "42"
}
fun foo2(): String {
return "42"
}
fun foo3(): String = "42"
fun foo4(): String = "42"
fun foo5(): String = "42"
Ktlint version: 1.0.1
The text was updated successfully, but these errors were encountered:
If a file contains multiple function bodies that have to be replaced with a body expression, then all should be replaced with a single run of ktlint.
Closes#2394
)
If a file contains multiple function bodies that have to be replaced with a body expression, then all should be replaced with a single run of ktlint.
Closes#2394
If a file contains multiple function bodies that have to be replaced with a body expression, then all should be replaced with a single run of ktlint.
Closes#2394
Given code below, then multiple runs of ktlint are needed to replace all function bodies with body expressions:
Note that after first run of ktlint command, up to 3 function bodies are replaced, as ktlint will automatically run 3 times in case format violations have been fixed. Output after first run:
Ktlint version: 1.0.1
The text was updated successfully, but these errors were encountered: