android/kotlin-guides

Continuation indent for parameter lists

Closed this issue · 3 comments

yole commented

The current Google style guide requires 8-space indent for wrapped function parameter lists: https://android.github.io/kotlin-guides/style.html#functions

In our style guide, we'd really prefer to require 4-space indents. The reason why 4-space indents work better is primary constructor parameters: we really want to have the same indent for val/var properties defined in the primary constructor and in the body of the class. And to separate the parameters from the body, the wrapped closing parenthesis followed by the opening curly brace (which your current example already shows) works well enough.

Is there any strong reason why you prefer 8-space indents? If not, could you change the guidance?

I absolutely prefer 4. I don't have notes as to why we picked 8. I have a fuzzy memory that the preview version of your style guide said 4 or 8 and we probably just picked one to avoid the "or".

lub0s commented

Since JB also released their guidlines could this be looked into and unified into 4 spaces probably ?