From cddaf352809c36fec3c8eac4a1f8890a018a8904 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 26 Aug 2026 12:38:23 -0400 Subject: [PATCH] android: ktlint forces a multiline signature at two parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `resolvedNoteColor` and `noteTintFor` are the first non-composable functions here to take more than one parameter, and ktlint_official's function-signature rule requires each parameter on its own line once there are two or more. Four findings on one and four on the other, all the same rule. Nothing had type-checked: ktlint is step 6 and the unit tests are step 8, so the fixture pinning the derived-tint mirror never ran. I checked line width, trailing whitespace and KDoc adjacency before pushing — the three that have bitten before — and not this one. The list of rules learned by failing CI is not the list of rules. Co-Authored-By: Claude Opus 5 --- .../main/java/com/fabledsword/thoughtsync/ui/DerivedTint.kt | 6 +++++- .../main/java/com/fabledsword/thoughtsync/ui/NoteTint.kt | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/android/app/src/main/java/com/fabledsword/thoughtsync/ui/DerivedTint.kt b/android/app/src/main/java/com/fabledsword/thoughtsync/ui/DerivedTint.kt index 1ca4ede..78e9b33 100644 --- a/android/app/src/main/java/com/fabledsword/thoughtsync/ui/DerivedTint.kt +++ b/android/app/src/main/java/com/fabledsword/thoughtsync/ui/DerivedTint.kt @@ -81,7 +81,11 @@ fun derivedTint(id: String): String { * `known` is passed in rather than read from `NOTE_TINTS` so this file stays free of * Compose and therefore testable; `noteTintFor` supplies the real set. */ -fun resolvedNoteColor(id: String, color: String, known: Set): String = +fun resolvedNoteColor( + id: String, + color: String, + known: Set, +): String = when { color.isNotEmpty() && color != "default" && color in known -> color // A draft carries DRAFT_ID (""), so there is no identity to derive from yet. diff --git a/android/app/src/main/java/com/fabledsword/thoughtsync/ui/NoteTint.kt b/android/app/src/main/java/com/fabledsword/thoughtsync/ui/NoteTint.kt index aef2744..971103f 100644 --- a/android/app/src/main/java/com/fabledsword/thoughtsync/ui/NoteTint.kt +++ b/android/app/src/main/java/com/fabledsword/thoughtsync/ui/NoteTint.kt @@ -185,5 +185,7 @@ fun noteTint(key: String): NoteTint = NOTE_TINTS[key] ?: NOTE_TINTS.getValue("de */ @Composable @ReadOnlyComposable -fun noteTintFor(id: String, color: String): NoteTint = - noteTint(resolvedNoteColor(id, color, NOTE_TINTS.keys)) +fun noteTintFor( + id: String, + color: String, +): NoteTint = noteTint(resolvedNoteColor(id, color, NOTE_TINTS.keys))