pinterest / ktlint

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

"align 'when' branches in columns" #2542

Closed mgroth0 closed 4 months ago

mgroth0 commented 5 months ago

Expected Rule behavior

The same behavior as IntelliJ's "align 'when' branches in columns"

This:

val result = when(input) {
    "abc" -> true
    "12345" -> false
}

Becomes:

val result = when(input) {
    "abc"   -> true
    "12345" -> false
}

Additional information

paul-dingemans commented 4 months ago

This will not be implemented. As documented in Kotlin Coding Conventions:

As a general rule, avoid horizontal alignment of any kind. Renaming an identifier to a name with a different length should not affect the formatting of either the declaration or any of the usages.