no-empty-file
What it does
Section titled “What it does”Reports a .kt file with nothing in it but a package, imports and comments.
Why it matters
Section titled “Why it matters”A file without a declaration is a leftover of a deleted class, or one that was never filled, and it still compiles and shows up in the project.
To fix, delete the file, or add the declaration.
Example
Section titled “Example”package a
import b.CConfiguration
Section titled “Configuration”kotlin: lint: rules: no-empty-file: warn # off (default), warn, errorEnabled by the presets: kotlin/ktlint.
Suppress one line with sudsy-disable-next-line no-empty-file 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 | no-empty-file |
full |