does it make sense for `detekt` to give warning fo...
# detekt
a
does it make sense for
detekt
to give warning for below code?
Copy code
fun test(foo: Int): Int {
   if (foo > 0) {
      return 0
   } else {
      return 1
   }
}
instead support below code
Copy code
fun test(foo: Int): Int {
   return if (foo > 0) {
      0
   } else {
      1
   }
}
same with
when
expression of variable assignment
b
I think that would be a good rule
s
I don't think such rules make sense without intention actions, which automatically fix code.
a
I have created the issue here https://github.com/detekt/detekt/issues/6233 Regarding intention, I agree that would be awesome. @Brais Gabin does
detekt
idea plugin provide intention and quick fixes?
b
No, as far as I know. But I never used the plugin so I can't say for sure.