Closed scottkennedy closed 4 weeks ago
Sometimes they fix bugs in the default formatting of Intellij IDEA as well. At least up and until 2024.1.6.
(build 241.19072.14) the when arrow was not indented.
Changing the indent will break formatting for all users running on older versions of the IDEA. For now, you can keep ktlint and IDEA formatting compatible by setting .editorconfig
property ij_kotlin_indent_before_arrow_on_new_line = false
(this property is comparable to the format setting below), but you should prefer to use the .editorconfig
property.
Note that Ktlint does not recognize this property at this moment. By setting it to false, you enforce IDEA formatting to comply with Ktlint formatting. Not setting the property, or setting it to true
results in a mismatch between Ktlint and IDEA formatting.
Expected Behavior
ktlint does not match IntelliJ code formatting. IntelliJ indents the
->
another 4 spaces, but ktlint wants it back out to line up withfoo
Observed Behavior
See comments in code
Steps to Reproduce
Run ktlint on the included code snippet.
Your Environment
.editorconfig
settings