Fix "Arrow is redundant when parameter list is empty"
And other issues that ktlint now reports
This commit is contained in:
committed by
Benoit Marty
parent
e22ecb68c3
commit
8bfb86683d
@@ -87,8 +87,10 @@ class HomeFlowNode(
|
||||
analyticsService.screen(MobileScreen(screenName = MobileScreen.ScreenName.Home))
|
||||
}
|
||||
)
|
||||
whenChildAttached { commonLifecycle: Lifecycle,
|
||||
changeRoomMemberRolesNode: ChangeRoomMemberRolesEntryPoint.NodeProxy ->
|
||||
whenChildAttached {
|
||||
commonLifecycle: Lifecycle,
|
||||
changeRoomMemberRolesNode: ChangeRoomMemberRolesEntryPoint.NodeProxy,
|
||||
->
|
||||
commonLifecycle.coroutineScope.launch {
|
||||
changeRoomMemberRolesNode.waitForRoleChanged()
|
||||
withContext(NonCancellable) {
|
||||
|
||||
@@ -34,14 +34,14 @@ class DefaultDeclineInviteTest {
|
||||
private val notificationCleaner =
|
||||
FakeNotificationCleaner(clearMembershipNotificationForRoomLambda = clearMembershipNotificationForRoomLambda)
|
||||
|
||||
private val successLeaveRoomLambda = lambdaRecorder<Result<Unit>> { -> Result.success(Unit) }
|
||||
private val successLeaveRoomLambda = lambdaRecorder<Result<Unit>> { Result.success(Unit) }
|
||||
private val successIgnoreUserLambda =
|
||||
lambdaRecorder<UserId, Result<Unit>> { _ -> Result.success(Unit) }
|
||||
private val successReportRoomLambda =
|
||||
lambdaRecorder<String?, Result<Unit>> { _ -> Result.success(Unit) }
|
||||
|
||||
private val failureLeaveRoomLambda =
|
||||
lambdaRecorder<Result<Unit>> { -> Result.failure(Exception("Leave room error")) }
|
||||
lambdaRecorder<Result<Unit>> { Result.failure(Exception("Leave room error")) }
|
||||
private val failureIgnoreUserLambda =
|
||||
lambdaRecorder<UserId, Result<Unit>> { _ -> Result.failure(Exception("Ignore user error")) }
|
||||
private val failureReportRoomLambda =
|
||||
|
||||
@@ -19,12 +19,12 @@ import org.junit.Test
|
||||
|
||||
class DefaultReportRoomTest {
|
||||
private val roomId = A_ROOM_ID
|
||||
private val successLeaveRoomLambda = lambdaRecorder<Result<Unit>> { -> Result.success(Unit) }
|
||||
private val successLeaveRoomLambda = lambdaRecorder<Result<Unit>> { Result.success(Unit) }
|
||||
private val successReportRoomLambda =
|
||||
lambdaRecorder<String?, Result<Unit>> { _ -> Result.success(Unit) }
|
||||
|
||||
private val failureLeaveRoomLambda =
|
||||
lambdaRecorder<Result<Unit>> { -> Result.failure(Exception("Leave room error")) }
|
||||
lambdaRecorder<Result<Unit>> { Result.failure(Exception("Leave room error")) }
|
||||
private val failureReportRoomLambda =
|
||||
lambdaRecorder<String?, Result<Unit>> { _ -> Result.failure(Exception("Report room error")) }
|
||||
|
||||
|
||||
@@ -148,9 +148,11 @@ class RoomDetailsFlowNode(
|
||||
|
||||
override fun onBuilt() {
|
||||
super.onBuilt()
|
||||
whenChildrenAttached { commonLifecycle: Lifecycle,
|
||||
roomDetailsNode: RoomDetailsNode,
|
||||
changeRoomMemberRolesNode: ChangeRoomMemberRolesEntryPoint.NodeProxy ->
|
||||
whenChildrenAttached {
|
||||
commonLifecycle: Lifecycle,
|
||||
roomDetailsNode: RoomDetailsNode,
|
||||
changeRoomMemberRolesNode: ChangeRoomMemberRolesEntryPoint.NodeProxy,
|
||||
->
|
||||
commonLifecycle.coroutineScope.launch {
|
||||
changeRoomMemberRolesNode.waitForRoleChanged()
|
||||
withContext(NonCancellable) {
|
||||
|
||||
@@ -105,9 +105,7 @@ class RoomDirectoryPresenterTest {
|
||||
|
||||
@Test
|
||||
fun `present - emit load more event`() = runTest {
|
||||
val loadMoreLambda = lambdaRecorder { ->
|
||||
Result.success(Unit)
|
||||
}
|
||||
val loadMoreLambda = lambdaRecorder<Result<Unit>> { Result.success(Unit) }
|
||||
val roomDirectoryList = FakeRoomDirectoryList(loadMoreLambda = loadMoreLambda)
|
||||
val roomDirectoryService = FakeRoomDirectoryService { roomDirectoryList }
|
||||
val presenter = createRoomDirectoryPresenter(roomDirectoryService = roomDirectoryService)
|
||||
|
||||
@@ -14,6 +14,7 @@ import kotlinx.collections.immutable.toPersistentList
|
||||
object WaveFormSamples {
|
||||
val allRangeWaveForm = List(100) { it.toFloat() / 100 }.toImmutableList()
|
||||
|
||||
@Suppress("ktlint:standard:argument-list-wrapping")
|
||||
val realisticWaveForm = persistentListOf(
|
||||
0.000f, 0.000f, 0.000f, 0.003f, 0.354f,
|
||||
0.353f, 0.365f, 0.790f, 0.787f, 0.167f,
|
||||
|
||||
@@ -71,10 +71,7 @@ public fun MapLibreMap(
|
||||
uiSettings: MapUiSettings = DefaultMapUiSettings,
|
||||
symbolManagerSettings: MapSymbolManagerSettings = DefaultMapSymbolManagerSettings,
|
||||
locationSettings: MapLocationSettings = DefaultMapLocationSettings,
|
||||
content: (
|
||||
@Composable @MapLibreMapComposable
|
||||
() -> Unit
|
||||
)? = null,
|
||||
content: (@Composable @MapLibreMapComposable () -> Unit)? = null,
|
||||
) {
|
||||
// When in preview, early return a Box with the received modifier preserving layout
|
||||
if (LocalInspectionMode.current) {
|
||||
|
||||
@@ -207,10 +207,12 @@ class RustTimeline(
|
||||
backwardPaginationStatus,
|
||||
forwardPaginationStatus,
|
||||
joinedRoom.roomInfoFlow.map { it.creators to it.isDm }.distinctUntilChanged(),
|
||||
) { timelineItems,
|
||||
) {
|
||||
timelineItems,
|
||||
backwardPaginationStatus,
|
||||
forwardPaginationStatus,
|
||||
(roomCreators, isDm) ->
|
||||
(roomCreators, isDm),
|
||||
->
|
||||
withContext(dispatcher) {
|
||||
timelineItems
|
||||
.let { items ->
|
||||
|
||||
@@ -34,7 +34,7 @@ class FakeNotificationCreator(
|
||||
var createFallbackNotificationResult: LambdaOneParamRecorder<FallbackNotifiableEvent, Notification> = lambdaRecorder { _ -> A_NOTIFICATION },
|
||||
var createSummaryListNotificationResult: LambdaFourParamsRecorder<MatrixUser, String, Boolean, Long, Notification> =
|
||||
lambdaRecorder { _, _, _, _ -> A_NOTIFICATION },
|
||||
var createDiagnosticNotificationResult: LambdaNoParamRecorder<Notification> = lambdaRecorder { -> A_NOTIFICATION },
|
||||
var createDiagnosticNotificationResult: LambdaNoParamRecorder<Notification> = lambdaRecorder<Notification> { A_NOTIFICATION },
|
||||
) : NotificationCreator {
|
||||
override suspend fun createMessagesListNotification(
|
||||
roomInfo: RoomEventGroupInfo,
|
||||
|
||||
@@ -114,7 +114,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||
assertThat(player1.prepare().isSuccess).isTrue()
|
||||
matchReadyState(1_000L)
|
||||
player1.play()
|
||||
awaitItem().let { // it plays until the end.
|
||||
awaitItem().let {
|
||||
// it plays until the end.
|
||||
assertThat(it.isReady).isFalse()
|
||||
assertThat(it.isPlaying).isFalse()
|
||||
assertThat(it.isEnded).isTrue()
|
||||
@@ -127,14 +128,16 @@ class DefaultVoiceMessagePlayerTest {
|
||||
player2.state.test {
|
||||
matchInitialState()
|
||||
assertThat(player2.prepare().isSuccess).isTrue()
|
||||
awaitItem().let { // Additional spurious state due to MediaPlayer owner change.
|
||||
awaitItem().let {
|
||||
// Additional spurious state due to MediaPlayer owner change.
|
||||
assertThat(it.isReady).isFalse()
|
||||
assertThat(it.isPlaying).isFalse()
|
||||
assertThat(it.isEnded).isTrue()
|
||||
assertThat(it.currentPosition).isEqualTo(1000)
|
||||
assertThat(it.duration).isEqualTo(1000)
|
||||
}
|
||||
awaitItem().let { // Additional spurious state due to MediaPlayer owner change.
|
||||
awaitItem().let {
|
||||
// Additional spurious state due to MediaPlayer owner change.
|
||||
assertThat(it.isReady).isFalse()
|
||||
assertThat(it.isPlaying).isFalse()
|
||||
assertThat(it.isEnded).isFalse()
|
||||
@@ -143,7 +146,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||
}
|
||||
matchReadyState(1_000L)
|
||||
player2.play()
|
||||
awaitItem().let { // it plays until the end.
|
||||
awaitItem().let {
|
||||
// it plays until the end.
|
||||
assertThat(it.isReady).isFalse()
|
||||
assertThat(it.isPlaying).isFalse()
|
||||
assertThat(it.isEnded).isTrue()
|
||||
@@ -154,7 +158,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||
|
||||
// Play player1 again.
|
||||
player1.state.test {
|
||||
awaitItem().let { // Last previous state/
|
||||
awaitItem().let {
|
||||
// Last previous state/
|
||||
assertThat(it.isReady).isFalse()
|
||||
assertThat(it.isPlaying).isFalse()
|
||||
assertThat(it.isEnded).isTrue()
|
||||
@@ -162,7 +167,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||
assertThat(it.duration).isEqualTo(1000)
|
||||
}
|
||||
assertThat(player1.prepare().isSuccess).isTrue()
|
||||
awaitItem().let { // Additional spurious state due to MediaPlayer owner change.
|
||||
awaitItem().let {
|
||||
// Additional spurious state due to MediaPlayer owner change.
|
||||
assertThat(it.isReady).isFalse()
|
||||
assertThat(it.isPlaying).isFalse()
|
||||
assertThat(it.isEnded).isFalse()
|
||||
@@ -171,7 +177,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||
}
|
||||
matchReadyState(1_000L)
|
||||
player1.play()
|
||||
awaitItem().let { // it played again until the end.
|
||||
awaitItem().let {
|
||||
// it played again until the end.
|
||||
assertThat(it.isReady).isFalse()
|
||||
assertThat(it.isPlaying).isFalse()
|
||||
assertThat(it.isEnded).isTrue()
|
||||
@@ -189,7 +196,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||
assertThat(player.prepare().isSuccess).isTrue()
|
||||
matchReadyState()
|
||||
player.play()
|
||||
skipItems(1) // skip play state
|
||||
// skip play state
|
||||
skipItems(1)
|
||||
player.pause()
|
||||
awaitItem().let {
|
||||
assertThat(it.isPlaying).isFalse()
|
||||
@@ -206,9 +214,11 @@ class DefaultVoiceMessagePlayerTest {
|
||||
assertThat(player.prepare().isSuccess).isTrue()
|
||||
matchReadyState()
|
||||
player.play()
|
||||
skipItems(1) // skip play state
|
||||
// skip play state
|
||||
skipItems(1)
|
||||
player.pause()
|
||||
skipItems(1) // skip pause state
|
||||
// skip pause state
|
||||
skipItems(1)
|
||||
player.play()
|
||||
awaitItem().let {
|
||||
assertThat(it.isPlaying).isTrue()
|
||||
|
||||
Reference in New Issue
Block a user