Javier
12/02/2020, 11:31 AMdata class
in a single line which ends with a trailing comma, using the detekt plugin to format it, the format keeps. But it should be changing to multiline (or at least delete the trailing comma, but with a strict mode I think it should be converted to multiline).
Another example is can be:
fun something() = "something"
fun something() =
"something"
The second one clearly should be reformated to the first one because it fits de space, but like both approach are valid, it doesn't get reformat
I love a lot how the reformat works in Dart/Flutter because it forces A LOT how the code should look. Overall about spacing and playing with trailing comma to reformat from single line (or a "broken multiline") to multiline that looks goodJon Michael Aanes
12/02/2020, 12:40 PMJavier
12/02/2020, 1:15 PMgammax
12/02/2020, 3:11 PMJavier
12/02/2020, 4:20 PMBrais Gabin
12/02/2020, 5:15 PMJavier
12/02/2020, 5:46 PMgammax
12/24/2020, 3:46 PMJavier
12/24/2020, 4:04 PMBrais Gabin
12/24/2020, 7:54 PMJavier
12/24/2020, 8:59 PMgammax
12/24/2020, 8:59 PMBut, if it is compatible it would be a great third party plugin, I think.☝️ This should probably be the way to go. As far as I’ve seen when developing the ktfmt Gradle plugin, we could have a generic
InvalidFormatting
rule that wrap a ktfmt call for a single file.