-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android studio code formatter issue over ktlint #410
Comments
As of ktlint 0.31.0, the formatter doesn't do a separate continuation indent, because it's not in either the Jetbrains nor Google Kotlin style guides. Can you please try the latest version (0.32.0) with the --experimental flag and report back what you find? Note that 0.32.0 moved the package namespace and groupId into com.pinterest. |
Isn't this an example of a continuation indent of 8? |
I suspect that's a documentation bug; when we spoke to the folks at Google in charge of the styleguide, they said they updated it to not use continuation indents. https://developer.android.com/kotlin/style-guide#indentation |
I recently integrated ktlint (v0.30.0) in my project. Things looks fine until i used android studio code formatter also. Using shortcut (cmd+option+L) in mac, it reformats the code again related to continuation indentation inside methods. Running ktlint on the formatted code did not give me the error and that was strange. Looks like continuation indentation of 4 and 8, both are correct as per ktlint. But ideally that should NOT be the case. Somehow continuation indentation inside methods is not working as expected for me.
My editorconfig file looks like this:
[*.{kt,kts}]
indent_size=4
insert_final_newline=true
max_line_length=off
While In android studio settings:
Tab size : 4
Indent : 4
Continuation Indent : 8
I don't want to use Continuation Indent from android studio settings rather it should use from editorconfig. One more things continuation_indent_size = 4 shows me unknown key error in editorconfig for kotlin files.
The text was updated successfully, but these errors were encountered: