saveourtool/diktat

Multiline strings and concatenation of strings

Open

#988 opened on 2021年7月16日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)Kotlin (40 forks)github user discovery
enhancementgood first issuehelp wantedneeded

Repository metrics

Stars
 (571 stars)
PR merge metrics
 (PR metrics pending)

説明

A lot of people follow java style and write the following code in Kotlin:

val a = "aaa \n" +
           "bbb \n" +
           "ccc \n" 

We can make it look much better in kotlin like style:

val a = """
    |aaa
    |bbb
    |ccc
“””.trimMargin()

Diktat should be able to raise warnings in such case if the default mode is used. In fix mode (with -F option) it should automatically fix such code.

コントリビューターガイド