Nothing in the build sorts imports, so review keeps doing it #3

Closed
opened 2026-08-12 11:50:57 +02:00 by thisilike · 0 comments
Owner

Import order has come up in two consecutive reviews of #2 and has been fixed by hand twice, in the touched files only. That is the wrong shape of fix: the next branch scrambles the next file, and a reviewer spends a line on it again.

A formatter ends the category. Two options, and the difference matters:

  • spotless with importOrder() only — sorts imports and touches nothing else. Small rule, small reflow, and it covers exactly what review keeps catching.
  • ktlint (through spotless or standalone) — the whole Kotlin style, of which import order is one rule. Bigger claim, and the first run reflows far more than imports.

Either way the first commit is a repo-wide reformat, which is why it was deliberately left out of #2: burying a mechanical diff over every file in an approved feature branch makes both harder to read. It wants its own PR that does nothing else.

Whichever is chosen, it needs a spotlessCheck (or ktlintCheck) step in .forgejo/workflows/build.yml beside the lintDebug step #2 added — a formatter nothing runs is the same as no formatter.

Import order has come up in two consecutive reviews of #2 and has been fixed by hand twice, in the touched files only. That is the wrong shape of fix: the next branch scrambles the next file, and a reviewer spends a line on it again. A formatter ends the category. Two options, and the difference matters: - **spotless with `importOrder()` only** — sorts imports and touches nothing else. Small rule, small reflow, and it covers exactly what review keeps catching. - **ktlint** (through spotless or standalone) — the whole Kotlin style, of which import order is one rule. Bigger claim, and the first run reflows far more than imports. Either way the first commit is a repo-wide reformat, which is why it was deliberately left out of #2: burying a mechanical diff over every file in an approved feature branch makes both harder to read. It wants its own PR that does nothing else. Whichever is chosen, it needs a `spotlessCheck` (or `ktlintCheck`) step in `.forgejo/workflows/build.yml` beside the `lintDebug` step #2 added — a formatter nothing runs is the same as no formatter.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
OpsDeck/mobile#3
No description provided.