My team just migrated from ktlint to ktfmt where we are leveraging the Gradle Plugin https://github.com/cortinico/ktfmt-gradle in CI. It is configured with the option googleStyle(). With the Gradle plugin, all trailing commas are left intact. However, when developers use the Intellij plugin to reformat the code, with the Code style set to Google (internal), the plugin seems to strip away all trailing commas.
The only way to keep the Gradle plugin's behavior consistent with the Intellij plugin's behavior is to use the default Code style for both. But then continuation indents require 4 spaces and we'd have to reformat our entire code base again.
My team just migrated from ktlint to ktfmt where we are leveraging the Gradle Plugin https://github.com/cortinico/ktfmt-gradle in CI. It is configured with the option
googleStyle()
. With the Gradle plugin, all trailing commas are left intact. However, when developers use the Intellij plugin to reformat the code, with the Code style set toGoogle (internal)
, the plugin seems to strip away all trailing commas.The only way to keep the Gradle plugin's behavior consistent with the Intellij plugin's behavior is to use the default Code style for both. But then continuation indents require 4 spaces and we'd have to reformat our entire code base again.