enum-entry-name-case
What it does
Section titled “What it does”Reports an enum entry whose name is neither PascalCase nor UPPER_SNAKE_CASE (a in enum class E { a, B }).
Why it matters
Section titled “Why it matters”Enum entries are constants, and the conventions for constants are UPPER_SNAKE_CASE or, since Kotlin reads them as objects, PascalCase. A lowercase entry reads as a property.
To fix, rename the entry in one of the two styles.
Example
Section titled “Example”enum class E { a, B, C_D, _e, FooBar }enum class F { `1x flows`, G_1, _2BIG }Configuration
Section titled “Configuration”kotlin: lint: rules: enum-entry-name-case: warn # off (default), warn, errorEnabled by the presets: kotlin/ktlint.
Suppress one line with sudsy-disable-next-line enum-entry-name-case 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 | enum-entry-name-case |
full |