diff --git a/build.gradle.kts b/build.gradle.kts index 8139ed6eb8..fe501b8f05 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -61,7 +61,7 @@ allprojects { config.from(files("$rootDir/tools/detekt/detekt.yml")) } dependencies { - detektPlugins("io.nlopez.compose.rules:detekt:0.4.5") + detektPlugins("io.nlopez.compose.rules:detekt:0.4.8") } // KtLint diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/ExpandableBottomSheetScaffold.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/ExpandableBottomSheetScaffold.kt index 3d61d43063..29bea5ca9e 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/ExpandableBottomSheetScaffold.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/ExpandableBottomSheetScaffold.kt @@ -58,7 +58,11 @@ import kotlin.math.roundToInt * @param modifier The modifier for the layout. * @param sheetContentKey The key for the sheet content. If the key changes, the sheet will be remeasured. */ -@Suppress("ContentTrailingLambda") +@Suppress( + "ContentTrailingLambda", + // False positive + "MultipleEmitters", +) @OptIn(ExperimentalMaterial3Api::class) @Composable internal fun ExpandableBottomSheetScaffold( diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt index ed6fffb90f..eb2cda8ca7 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt @@ -218,6 +218,7 @@ private fun SheetContent( } } +@Suppress("MultipleEmitters") // False positive @Composable private fun MessageSummary(event: TimelineItem.Event, modifier: Modifier = Modifier) { val content: @Composable () -> Unit diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventRow.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventRow.kt index 528217d367..1116817ace 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventRow.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventRow.kt @@ -376,6 +376,7 @@ private fun MessageSenderInformation( } } +@Suppress("MultipleEmitters") // False positive @Composable private fun MessageEventBubbleContent( event: TimelineItem.Event, diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemReactionsLayout.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemReactionsLayout.kt index b4ec1e7461..77e6c5b9ff 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemReactionsLayout.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemReactionsLayout.kt @@ -110,7 +110,7 @@ fun TimelineItemReactionsLayout( } val rows = rowsIn.toMutableList() val secondLastRow = rows[rows.size - 2].toMutableList() - val expandButtonPlaceable = secondLastRow.removeLast() + val expandButtonPlaceable = secondLastRow.removeAt(secondLastRow.lastIndex) lastRow.add(0, expandButtonPlaceable) rows[rows.size - 2] = secondLastRow rows[rows.size - 1] = lastRow diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/typing/TypingNotificationView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/typing/TypingNotificationView.kt index c568635a02..4ab81677d3 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/typing/TypingNotificationView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/typing/TypingNotificationView.kt @@ -53,6 +53,7 @@ import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.matrix.api.room.RoomMember import kotlinx.collections.immutable.ImmutableList +@Suppress("MultipleEmitters") // False positive @Composable fun TypingNotificationView( state: TypingNotificationState, diff --git a/libraries/roomselect/impl/src/main/kotlin/io/element/android/libraries/roomselect/impl/RoomSelectView.kt b/libraries/roomselect/impl/src/main/kotlin/io/element/android/libraries/roomselect/impl/RoomSelectView.kt index ba683438e6..ef2fea495e 100644 --- a/libraries/roomselect/impl/src/main/kotlin/io/element/android/libraries/roomselect/impl/RoomSelectView.kt +++ b/libraries/roomselect/impl/src/main/kotlin/io/element/android/libraries/roomselect/impl/RoomSelectView.kt @@ -64,6 +64,7 @@ import io.element.android.libraries.ui.strings.CommonStrings import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.toPersistentList +@Suppress("MultipleEmitters") // False positive @OptIn(ExperimentalMaterial3Api::class) @Composable fun RoomSelectView( diff --git a/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsView.kt b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsView.kt index 26232f8d69..b48af4480f 100644 --- a/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsView.kt +++ b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsView.kt @@ -16,6 +16,7 @@ package io.element.android.libraries.troubleshoot.impl +import androidx.compose.foundation.layout.ColumnScope import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.size import androidx.compose.foundation.progressSemantics @@ -68,7 +69,7 @@ fun TroubleshootNotificationsView( } @Composable -private fun TroubleshootTestView( +private fun ColumnScope.TroubleshootTestView( testState: NotificationTroubleshootTestState, onQuickFixClick: () -> Unit, ) { @@ -127,7 +128,7 @@ private fun TroubleshootTestView( } @Composable -private fun TroubleshootNotificationsContent(state: TroubleshootNotificationsState) { +private fun ColumnScope.TroubleshootNotificationsContent(state: TroubleshootNotificationsState) { when (state.testSuiteState.mainState) { AsyncAction.Loading, AsyncAction.Confirming, @@ -197,7 +198,7 @@ private fun RunTestButton(state: TroubleshootNotificationsState) { } @Composable -private fun TestSuiteView( +private fun ColumnScope.TestSuiteView( testSuiteState: TroubleshootTestSuiteState, onQuickFixClick: (Int) -> Unit, ) {