Enable detekt rules CascadingCallWrapping and fix existing issues.
This commit is contained in:
committed by
Benoit Marty
parent
03cefb2c79
commit
1d3aa2cd05
@@ -58,7 +58,8 @@ class LoggedInEventProcessor @Inject constructor(
|
||||
.filter { it }
|
||||
.onEach {
|
||||
displayMessage(CommonStrings.common_verification_complete)
|
||||
}.launchIn(this)
|
||||
}
|
||||
.launchIn(this)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,14 +44,14 @@ import io.element.android.appnav.loggedin.LoggedInNode
|
||||
import io.element.android.appnav.room.RoomFlowNode
|
||||
import io.element.android.appnav.room.RoomLoadedFlowNode
|
||||
import io.element.android.features.createroom.api.CreateRoomEntryPoint
|
||||
import io.element.android.features.ftue.api.FtueEntryPoint
|
||||
import io.element.android.features.ftue.api.state.FtueState
|
||||
import io.element.android.features.invitelist.api.InviteListEntryPoint
|
||||
import io.element.android.features.networkmonitor.api.NetworkMonitor
|
||||
import io.element.android.features.networkmonitor.api.NetworkStatus
|
||||
import io.element.android.features.preferences.api.PreferencesEntryPoint
|
||||
import io.element.android.features.roomlist.api.RoomListEntryPoint
|
||||
import io.element.android.features.verifysession.api.VerifySessionEntryPoint
|
||||
import io.element.android.features.ftue.api.FtueEntryPoint
|
||||
import io.element.android.features.ftue.api.state.FtueState
|
||||
import io.element.android.libraries.architecture.BackstackNode
|
||||
import io.element.android.libraries.architecture.NodeInputs
|
||||
import io.element.android.libraries.architecture.animation.rememberDefaultTransitionHandler
|
||||
@@ -305,7 +305,8 @@ class LoggedInFlowNode @AssistedInject constructor(
|
||||
override fun onFtueFlowFinished() {
|
||||
backstack.pop()
|
||||
}
|
||||
}).build()
|
||||
})
|
||||
.build()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,8 @@ class RoomFlowNode @AssistedInject constructor(
|
||||
} else {
|
||||
backstack.newRoot(NavTarget.Loading)
|
||||
}
|
||||
}.launchIn(lifecycleScope)
|
||||
}
|
||||
.launchIn(lifecycleScope)
|
||||
}
|
||||
|
||||
override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node {
|
||||
|
||||
@@ -115,7 +115,8 @@ class RoomLoadedFlowNode @AssistedInject constructor(
|
||||
room.updateMembers()
|
||||
.onFailure {
|
||||
Timber.e(it, "Fail to fetch members for room ${room.roomId}")
|
||||
}.onSuccess {
|
||||
}
|
||||
.onSuccess {
|
||||
Timber.v("Success fetching members for room ${room.roomId}")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,14 +103,17 @@ class MediaViewerPresenter @AssistedInject constructor(
|
||||
)
|
||||
.onSuccess {
|
||||
mediaFile.value = it
|
||||
}.mapCatching { mediaFile ->
|
||||
}
|
||||
.mapCatching { mediaFile ->
|
||||
localMediaFactory.createFromMediaFile(
|
||||
mediaFile = mediaFile,
|
||||
mediaInfo = inputs.mediaInfo
|
||||
)
|
||||
}.onSuccess {
|
||||
}
|
||||
.onSuccess {
|
||||
localMedia.value = Async.Success(it)
|
||||
}.onFailure {
|
||||
}
|
||||
.onFailure {
|
||||
localMedia.value = Async.Failure(it)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +268,8 @@ class MessageComposerPresenter @Inject constructor(
|
||||
mediaSender.sendMedia(uri, mimeType, compressIfPossible = false, progressCallback)
|
||||
.onSuccess {
|
||||
attachmentState.value = AttachmentsState.None
|
||||
}.onFailure {
|
||||
}
|
||||
.onFailure {
|
||||
val snackbarMessage = SnackbarMessage(sendAttachmentError(it))
|
||||
snackbarDispatcher.post(snackbarMessage)
|
||||
attachmentState.value = AttachmentsState.None
|
||||
|
||||
@@ -73,7 +73,8 @@ class RoomListDataSource @Inject constructor(
|
||||
}
|
||||
.onEach {
|
||||
_filteredRooms.value = it
|
||||
}.launchIn(coroutineScope)
|
||||
}
|
||||
.launchIn(coroutineScope)
|
||||
}
|
||||
|
||||
fun updateFilter(filterValue: String) {
|
||||
|
||||
@@ -137,7 +137,8 @@ object PermalinkParser {
|
||||
.parameterList
|
||||
.filter {
|
||||
it.mParameter == "via"
|
||||
}.map {
|
||||
}
|
||||
.map {
|
||||
URLDecoder.decode(it.mValue, "UTF-8")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,7 +147,8 @@ class RustMatrixClient constructor(
|
||||
if (syncState == SyncState.Running) {
|
||||
onSlidingSyncUpdate()
|
||||
}
|
||||
}.launchIn(sessionCoroutineScope)
|
||||
}
|
||||
.launchIn(sessionCoroutineScope)
|
||||
}
|
||||
|
||||
override suspend fun getRoom(roomId: RoomId): MatrixRoom? {
|
||||
@@ -227,7 +228,8 @@ class RustMatrixClient constructor(
|
||||
roomSummaryDataSource.allRooms()
|
||||
.filter { roomSummaries ->
|
||||
roomSummaries.map { it.identifier() }.contains(roomId.value)
|
||||
}.first()
|
||||
}
|
||||
.first()
|
||||
}
|
||||
roomId
|
||||
}
|
||||
|
||||
@@ -64,7 +64,8 @@ internal class RustRoomSummaryDataSource(
|
||||
.map { it.toRoomSummaryDataSourceLoadingState() }
|
||||
.onEach {
|
||||
allRoomsLoadingState.value = it
|
||||
}.launchIn(this)
|
||||
}
|
||||
.launchIn(this)
|
||||
|
||||
launch {
|
||||
// Wait until running, as invites is only available after that
|
||||
|
||||
@@ -113,7 +113,8 @@ class RustMatrixTimeline(
|
||||
innerRoom.backPaginationStatusFlow()
|
||||
.onEach {
|
||||
postPaginationStatus(it)
|
||||
}.launchIn(this)
|
||||
}
|
||||
.launchIn(this)
|
||||
|
||||
fetchMembers()
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
# Default rules: https://github.com/detekt/detekt/blob/main/detekt-core/src/main/resources/default-detekt-config.yml
|
||||
|
||||
style:
|
||||
CascadingCallWrapping:
|
||||
active: true
|
||||
includeElvis: true
|
||||
MaxLineLength:
|
||||
# Default is 120
|
||||
maxLineLength: 160
|
||||
|
||||
Reference in New Issue
Block a user