-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Match indent to continuation indent? #196
Comments
I kind of like this change, but I think it's just a matter of personal preference. Whatever team decides I want to point out that |
It doesn't change the fact that now ktlint has deviated from the official kotlin and android style guides. The official Kotlin style guide takes things like constructor parameters and makes them use single indents instead of continuation indents (as they would normally). ktlint should just support this properly by changing the expected indent there from a continuation indent to a normal indent. Instead of supporting it properly though, the recommendation is to just take continuation indent == to normal indent. This solution is against both style guides, as both style guides still have continuation indents that are expected to be twice the normal indent. Another example is method chaining. The kotlin style guide specifies that chained methods should be used with normal indents, not continuation indents. I'm sure there are others. Ktlint should match these changes in the same way. |
|
Good explanation. We have twp separate discussions here...getting back to my point |
Thanks for the clarification, @igorwojda. I'll look into it. |
Closing in favor of #120. @igorwojda it seems like |
The documentation for the most recent version currently states:
Isn't this against the Kotlin and Android style guides? Both style guides have / use continuation indents currently, and the continuation indents are expected to be double the normal indent (defaulting to 8). In order to compensate, many things that would normally use continuation indents, no longer use continuation indents. i.e. constructor properties, or method chaining:
The solution of making the continuation indent to match the normal indent seems wrong. Instead, ktlint needs to be updated to stop expecting continuation indents in locations where the style guide prohibits them.
The text was updated successfully, but these errors were encountered: