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
913 stars 76 forks source link

don't break first line when formatting method chaining. #232

Closed sschemer closed 5 months ago

sschemer commented 3 years ago
ktfmf

in lambda body of above code, I think it will be better if not breaking first line and reducing space before later method callings.

hick209 commented 5 months ago

As of v0.47

it.USER_LOCATION?.let { location ->
    it.STORES_OF_CUR_CITY.filter { store -> store.storeType == storetype }
        .minByOrNull {
            val latLng = store.latLang()
            val distance =
                AMapUtils.calculateLineDistance(
                    LatLng(location.latitude, location.longitude),
                    LatLng(latLng.latitude, latLng.longitude)
                )
            distance
        }
        ?.let { store ->
            BookingConstants.CUR_STORE = store
            RxBus.Instance().send(BookingConstants.EVENT_CHANGE_STORE)
        }
}