pinterest / ktlint

An anti-bikeshedding Kotlin linter with built-in formatter
https://pinterest.github.io/ktlint/
MIT License
6.19k stars 505 forks source link

Break dependency between `string-template-indent` and `multiline-expression-wrapping` #2504

Closed paul-dingemans closed 8 months ago

paul-dingemans commented 8 months ago

Currently the string-template-indent depends on the multiline-expression-wrapping to wrap the opening quotes of a multiline raw string literal in cases like below:

val foo = """
    some text
   """.trimIndent()

Although it is convenient from a technical perspective to rely on multiline-expression-wrapping to wrap the quotes, it forces the users to accept wrapping of all other multiline expressions as well.

As the wrapping logic for the opening quotes is not to complicated, it should be duplicated into the string-template-indent rule.

Originally posted by @paul-dingemans in https://github.com/pinterest/ktlint/issues/2338#issuecomment-1890953266