What version of ktlint does ktlint-maven-plugin 1....
# ktlint
j
What version of ktlint does ktlint-maven-plugin 1.16.0 correspond to? I have ktlint 0.49.1 installed but I get warnings (
Missing { ... }
) with the maven plugin that I don't get with the command-line tool.
s
j
Huh, was a rule about having curlies on every if/else clause relaxed in 0.49.x?
s
j
Hm, it looks like 0.49 allows mixed-multiline like
Copy code
val myVal = 
    if (condition) {
        valueIfTrue
    } else valueIfFalse
Whereas 0.48 does not
0.48 requires
Copy code
val myVal = 
    if (condition) {
        valueIfTrue
    } else {
        valueIfFalse
    }
Hm, no, that's not exactly the difference, let me see if I can figure out the specific difference
s
ok. you can also just file a bug if you're unsure
j
Ok, here's the specific code that 0.48 dislikes but 0.49.1 is ok with:
Copy code
var expectedValue: Int = 0
val map = HashMap<Int, Int>()

fun test(value: Int): Boolean {
    return if (value == expectedValue) {
        true
    } else map.containsKey(value)
}
s
ah
i'm not sure if that's a bug haha but please file it
j
Ah! Known issue, fixed in master: https://github.com/pinterest/ktlint/issues/2057