Skip to content
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

Rule for continuation indentation #1136

Closed
huehnerlady opened this issue Apr 22, 2021 · 4 comments
Closed

Rule for continuation indentation #1136

huehnerlady opened this issue Apr 22, 2021 · 4 comments

Comments

@huehnerlady
Copy link

Expected Rule behavior

I would like to add a rule where you can have a different indent size when going into continuation.
In the editorconfig I believe would be as follows:

root = true
[*]
indent_size = 2
indent_style = space
tab_width = 2
ij_continuation_indent_size = 8

[{*.gradle.kts,*.kt,*.kts,*.main.kts}]
ij_kotlin_continuation_indent_in_argument_lists = true

Currently I get an error: error: Unexpected indentation (12) (should be 6) (indent)

Additional information

  • Current version of ktlint: 0.41.0 (via github action)
  • Styleguide section: for continuation indentation the indent size ij_continuation_indent_size should be used
@klobuczek
Copy link

Whatever it is the default klint formatter config should not reformat code formatted with the default IntelliJ formatter config. Furthermore, any combination of the 2 formatters should be idempotent.

@huehnerlady
Copy link
Author

Whatever it is the default klint formatter config should not reformat code formatted with the default IntelliJ formatter config. Furthermore, any combination of the 2 formatters should be idempotent.

@klobuczek many thanks for your comment. unfortunately I do not completely your intent about this. What exactly do you mean by your comment? I did not say about any combination, but to support continuation indentation

@klobuczek
Copy link

@huehnerlady I mentioned this because we run into exactly the problem you describe. One team member installed klint and reformated the continuation indent set by IntelliJ. So my comment is an extension to your request to provide such a rule and make sure that the rule is by default consistent with the IDE default.

@romtsn
Copy link
Collaborator

romtsn commented Dec 1, 2021

#816

@romtsn romtsn closed this as completed Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants