class-naming
What it does
Section titled “What it does”Reports a class, interface or object whose name starts with a lowercase letter or an underscore.
Why it matters
Section titled “Why it matters”Kotlin follows the convention that types are in PascalCase, so a lowercase name reads as a variable or a function and is mistaken for one at the call site.
To fix, rename the class to PascalCase.
Example
Section titled “Example”class my_classclass Goodinterface otherobject lowerobject Fineclass `a name`Configuration
Section titled “Configuration”kotlin: lint: rules: class-naming: warn # off (default), warn, errorEnabled by the presets: kotlin/ktlint.
Suppress one line with sudsy-disable-next-line class-naming in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.
| Tool | Rule | Match | What differs |
|---|---|---|---|
| ktlint | class-naming |
partial | Names in backticks are accepted; no test-file exceptions. |