ktfmt icon indicating copy to clipboard operation
ktfmt copied to clipboard

add trailing comma support to other non-google styles

Open hongping-quora opened this issue 1 year ago • 4 comments

It seems google-style now supports trailing commas, wondering if this can be applied to other styles too? Thanks!

https://github.com/facebook/ktfmt/commit/fa78077aadf86d45f5ef89d1a044de67ce07cb8f

hongping-quora avatar Mar 13 '24 18:03 hongping-quora

What styles did you have in mind to add this feature to @hongping-quora?

hick209 avatar Mar 25 '24 19:03 hick209

All the other styles if possible (default, dropbox, and kotlinLang), or maybe flag/option to turn in on?

https://github.com/facebook/ktfmt/pull/427#issuecomment-1751652795

hongping-quora avatar Mar 25 '24 19:03 hongping-quora

This would be a great improvement! We're currently considering whether we should change style or tool just to get a consistent (and preferrably deterministic) way of handling trailing commas.

albin-mullvad avatar Apr 22 '24 08:04 albin-mullvad

This is part of the 1.0 proposal (https://github.com/facebook/ktfmt/discussions/451#discussioncomment-9305741)

hick209 avatar May 03 '24 12:05 hick209

In Android we are using the kotlinlang style and being able to support trailing commas without having to completely format all our files with a different style would be really great :-)

jdemeulenaere avatar May 22 '24 15:05 jdemeulenaere

@omarismail94, would you (Android X) be okay with this for kotlinlang?

hick209 avatar Jun 11 '24 13:06 hick209

Yep, SGTM!

omarismail94 avatar Jun 11 '24 16:06 omarismail94

Trailing commas will be the default starting on 1.0.0

https://github.com/facebook/ktfmt/commit/cec9b501428d5236c306ce2b50adc4cbe0338ffe

hick209 avatar Jun 18 '24 13:06 hick209

That's great, thanks! When can we expect 1.0.0 to be released? :-)

jdemeulenaere avatar Jun 19 '24 08:06 jdemeulenaere

We don't have a particular timeline in place, but we are currently testing the changes for it. If all is good and the API is stable, you could expect us to have it by July.

hick209 avatar Jun 19 '24 12:06 hick209

Any update on the 1.0.0 release by any chance?

Thanks!

jdemeulenaere avatar Aug 15 '24 09:08 jdemeulenaere

Update is that there was some push back internally on some of the changes from 1.0.

We still pushed an update that included trailing comma to kotlinlang style though and hopefully this would help ease the transition and at least something this issues here.

Let me know if you have more questions, @jdemeulenaere

hick209 avatar Aug 27 '24 18:08 hick209