facebook / ktfmt

A program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions.
https://facebook.github.io/ktfmt/
Apache License 2.0
907 stars 75 forks source link

add trailing comma support to other non-google styles #442

Closed hongping-quora closed 3 months ago

hongping-quora commented 6 months ago

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

hick209 commented 6 months ago

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

hongping-quora commented 6 months ago

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

albin-mullvad commented 5 months ago

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.

hick209 commented 5 months ago

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

jdemeulenaere commented 4 months ago

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 :-)

hick209 commented 3 months ago

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

omarismail94 commented 3 months ago

Yep, SGTM!

hick209 commented 3 months ago

Trailing commas will be the default starting on 1.0.0

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

jdemeulenaere commented 3 months ago

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

hick209 commented 3 months ago

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.

jdemeulenaere commented 1 month ago

Any update on the 1.0.0 release by any chance?

Thanks!

hick209 commented 1 month ago

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