android: ktlint forces a multiline signature at two parameters
`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 <noreply@anthropic.com>
This commit is contained in:
@@ -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>): String =
|
||||
fun resolvedNoteColor(
|
||||
id: String,
|
||||
color: String,
|
||||
known: Set<String>,
|
||||
): String =
|
||||
when {
|
||||
color.isNotEmpty() && color != "default" && color in known -> color
|
||||
// A draft carries DRAFT_ID (""), so there is no identity to derive from yet.
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user