when-entry-bracing
What it does
Section titled “What it does”Reports a when entry whose first line the formatter would change.
Why it matters
Section titled “Why it matters”Entries of one when that are written in different ways (some with braces, some without, in different line layouts) look as if the difference meant something. One layout for all entries makes a real difference stand out.
To fix, run the formatter.
Example
Section titled “Example”... else -> println(2) } foo(); bar()...Configuration
Section titled “Configuration”kotlin: lint: rules: when-entry-bracing: warn # off (default), warn, errorEnabled by the presets: kotlin/ktlint.
Suppress one line with sudsy-disable-next-line when-entry-bracing in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| ktlint | when-entry-bracing |
full |