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
I think we should enable trailing commas in our styleguide. My primary motivation is that it increases the readability of git diffs. See the following example:
val example =listOf(
1,
2
)
which when extended will produce the following diff:
val example = listOf(
1,
~ 2, // changed line
+ 3 // added line
)
vs
val example =listOf(
1,
2,
)
which produces the following diff:
val example = listOf(
1,
2,
+ 3, // only added line
)
We can enforce this change using ktlint, when support for this flag is merged to the mainline branch (pinterest/ktlint#709)
However, the latest version of ktlint has not been published to brew. When that is done, let's get this rolling 🙂
While we're on it, I also propose that we switch from the 'regular' version of ktlint to the --android-version. Doing that (+ adding trailing commas) will be a fairly large PR, but it will be only cosmetic changes that hopefully can be auto-applied.
I think we should enable trailing commas in our styleguide. My primary motivation is that it increases the readability of git diffs. See the following example:
which when extended will produce the following diff:
vs
which produces the following diff:
We can enforce this change using
ktlint
, when support for this flag is merged to the mainline branch (pinterest/ktlint#709)What are your opinions on the subject? @StylianosGakis @hugokallstrom
The text was updated successfully, but these errors were encountered: