ktfmt icon indicating copy to clipboard operation
ktfmt copied to clipboard

A program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions.

Results 127 ktfmt issues
Sort by recently updated
recently updated
newest added

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.

CLA Signed

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...

bug

When I format with ktfmt and have (german) umlauts like "ä" oder "ü" in a string value, I get this warning: ![grafik](https://user-images.githubusercontent.com/31124997/222682397-26269cc9-cc4c-446e-bdd2-c3c04d6510ad.png) 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

enhancement
formatting-discussions

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...

question

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")...

formatting-discussions

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...

enhancement
formatting-discussions

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...

formatting-discussions