Ktlint: Default continuation indent for Android should be 8 not 4

Created on 4 Dec 2017  路  6Comments  路  Source: pinterest/ktlint

This commit changes continuation indent from 8 to 4.
According to Android Kotlin style guide it should be 8.
I guess confusion comes from https://github.com/android/kotlin-guides/issues/37. But that issue is about usage of "indent" instead of "continuation indent" for parameter list. Not about changing the size of continuation indent.

Most helpful comment

"Android Kotlin Style Guide prescribes +8 continuation indentation (+4 for parameters)."

Is there a way to specify that in IntelliJ / Android Studio? The "continuation indent" setting seems to control both.

All 6 comments

@MyDogTom right. Thanks for pointing it out.

I think this was recently changed to be 4.

They wanted to have the fields in classes aligned with everything else and hence they made that change. https://github.com/android/kotlin-guides/issues/37

@vanniktech see latest https://github.com/android/kotlin-guides/blob/master/style.md#continuation-indent. @MyDogTom is right. Android Kotlin Style Guide prescribes +8 continuation indentation (+4 for parameters).

"Android Kotlin Style Guide prescribes +8 continuation indentation (+4 for parameters)."

Is there a way to specify that in IntelliJ / Android Studio? The "continuation indent" setting seems to control both.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tonilopezmr picture tonilopezmr  路  4Comments

chao2zhang picture chao2zhang  路  4Comments

Jacksgong picture Jacksgong  路  3Comments

plastiv picture plastiv  路  4Comments

DanteAndroid picture DanteAndroid  路  3Comments