Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"align 'when' branches in columns" #2542

Closed
mgroth0 opened this issue Feb 6, 2024 · 1 comment
Closed

"align 'when' branches in columns" #2542

mgroth0 opened this issue Feb 6, 2024 · 1 comment

Comments

@mgroth0
Copy link

mgroth0 commented Feb 6, 2024

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

  • Current version of ktlint: 1.1.1
@paul-dingemans
Copy link
Collaborator

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.

@paul-dingemans paul-dingemans closed this as not planned Won't fix, can't repro, duplicate, stale Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants