ktfmt
ktfmt copied to clipboard
A program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions.
I've recently added support for ktfmt to pre-commit hooks. https://github.com/macisamuele/language-formatters-pre-commit-hooks/pull/196 I thought it'd be worth mentioning in the README.
Trailing comma gets removed if there is only one parameter and it is formatted to be on its own line
Using the ktfmt IntelliJ plugin 1.1.0.47 in Android Studio, setting "Code style" to "Google (internal)" 1. The following code with a single parameter will get the trailing comma removed. ```...
In one of our projects, we have a util named `multiCatch` which we can tack on to the end of a lambda to more easily follow set logic when catching...
When I format with ktfmt and have (german) umlauts like "ä" oder "ü" in a string value, I get this warning:  The input value is: "Müller Maha Ag" Actual...
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
Originally posted in https://github.com/cortinico/ktfmt-gradle/issues/264 ## 🐛 Describe the bug Formatting with the Android Studio ktfmt plugin produces a different result than ktfmtFormat via Gradle and https://facebook.github.io/ktfmt/. ## ⚠️ Current behavior...
Jetpack compose is a declarative UI toolkit. If you have the ktfmt plugin + are working in compose code and hit "enter" to autocomplete something simple like a layout like...
If I have the following code, ```kotlin val input = "abc" val example = try { input.fakeFunction(a = "aaaaaaaaaaaaaaa", b = "bbbbbbbbbbb", c = "cccccccccccc").map { strng -> strng.replace("a", "b")...
This is a followup to #213. Currently, a trailing Elvis operator is placed on the same line as the last step of a call chain if it fits: ```kotlin desiredWithdrawals...
I have some code using the restassured library, which is using infix functions, and that currently get formatted very strangely because it uses infix functions. ```kt val response = Given...