https://kotlinlang.org logo
#ktfmt
Title
# ktfmt
s

stefanem

11/22/2023, 3:00 PM
Hi all. I am looking for some clarification as to why ktfmt uses 2 spaces for indentation. What confuses me is that here: https://github.com/facebook/ktfmt/issues/14#issuecomment-674487325 it is said that the official Kotlin style guides uses 2 spaces, yet when looking here: https://kotlinlang.org/docs/coding-conventions.html#indentation it says ‘use four spaces’. Why does ktfmt use 2 spaces? 🤔 I hope someone can clear this up. Many thanks everyone!
j

Javier

11/22/2023, 4:44 PM
if you set kotlinlang style it uses 4 spaces.
👍 1
n

Nivaldo H Bondança

01/08/2024, 11:33 AM
The rationale is because this was created by Meta and the default style is the Meta style. Meta code is all formatted with 4 spaces. I hope this clarifies
4 Views