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