import-ordering
What it does
Section titled “What it does”Reports an import list that the formatter would reorder or rewrite.
Why it matters
Section titled “Why it matters”Imports in a fixed order make it easy to find one, and two developers who add an import in the same place do not conflict.
To fix, run the formatter.
Example
Section titled “Example”import b.Bimport a.A
... 1 -> {...import b.Bimport a.A
... 1 -> {...Configuration
Section titled “Configuration”kotlin: lint: rules: import-ordering: warn # off (default), warn, errorEnabled by the presets: kotlin/ktlint.
Suppress one line with sudsy-disable-next-line import-ordering 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 | import-ordering |
full |