アプリ開発備忘録

PlayStationMobile、Android、UWPの開発備忘録

Kotlinの継続的IndentをIDEAとktlintでの違いを揃える

違い

以下がIDEAです。
8つスペースになっています。

type != Hoge.Fuga.A &&
        type != Hoge.Fuga.B &&
        type != Hoge.Fuga.C &&
        type != Hoge.Fuga.D &&
        type != Hoge.Fuga.E

ktlintが以下です。
4つスペースになっています。

type != Hoge.Fuga.A &&
    type != Hoge.Fuga.B &&
    type != Hoge.Fuga.C &&
    type != Hoge.Fuga.D &&
    type != Hoge.Fuga.E

対応

ktlintは継続的Indentに対応していません。IntelliJ側をktlintに寄せる必要があります。
https://github.com/pinterest/ktlint/issues/816

.editorconfig

ij_kotlin_continuation_indent_size = 4