ktfmt icon indicating copy to clipboard operation
ktfmt copied to clipboard

Indentation level should be a command-line argument

Open notfed opened this issue 11 months ago • 1 comments

Defaulting to 2-spaces is a bit...odd. If you really insist on 2-spaces, provide a separate command-line argument to override this.

Your README says:

--dropbox-style makes ktfmt use a block indent of 4 spaces instead of 2. See below for details.

Note: There is no configurability as to the formatter's algorithm for formatting (apart from --dropbox-style). This is a deliberate design decision to unify our code formatting on a single format.

But...both kotlinlang.com and Google recommend 4-space indentation for Kotlin.

notfed avatar Mar 16 '24 19:03 notfed

What are you suggesting to be done here? Change the default to 4 spaces?

You could specify --kotlinlang-style to use the Kotlin recommended one. We do not have the intention to change the default.

FWIW Google uses 2 space formatting for their code as well (see the --google-style), the one you mentioned is the Android recommendation, which is different from how they write their code internally.

hick209 avatar Mar 26 '24 11:03 hick209

Closed due to lack of response

hick209 avatar Jun 05 '24 15:06 hick209