Update plugin ktlint to v12.1.0 (#2200)
* Update plugin ktlint to v12.1.0 * Run `./gradlew ktlintFormat` and fix some issues manually. * Fix other issues reproted by Ktlint * Limit false positives, KtLint removes unnecessary curly brace in String templates. * Remove useless Unit * Minor improvements over ktlint changes * Restore `AlertDialogContent` behaviour * Update screenshots --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Benoit Marty <benoit@matrix.org> Co-authored-by: Jorge Martín <jorgem@element.io> Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
parent
7e1866818e
commit
c8bd362397
442 changed files with 1091 additions and 1081 deletions
|
|
@ -24,4 +24,4 @@ data class MatrixHomeServerDetails(
|
|||
val url: String,
|
||||
val supportsPasswordLogin: Boolean,
|
||||
val supportsOidcLogin: Boolean,
|
||||
): Parcelable
|
||||
) : Parcelable
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ value class SpaceId(val value: String) : Serializable {
|
|||
if (BuildConfig.DEBUG && !MatrixPatterns.isSpaceId(value)) {
|
||||
error(
|
||||
"`$value` is not a valid space id.\n" +
|
||||
"Space ids are the same as room ids.\n" +
|
||||
"Example space id: `!space_id:domain`."
|
||||
"Space ids are the same as room ids.\n" +
|
||||
"Example space id: `!space_id:domain`."
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ value class ThreadId(val value: String) : Serializable {
|
|||
if (BuildConfig.DEBUG && !MatrixPatterns.isThreadId(value)) {
|
||||
error(
|
||||
"`$value` is not a valid thread id.\n" +
|
||||
"Thread ids are the same as event ids.\n" +
|
||||
"Example thread id: `\$Rqnc-F-dvnEYJTyHq_iKxU2bZ1CI92-kuZq3a5lr5Zg`."
|
||||
"Thread ids are the same as event ids.\n" +
|
||||
"Example thread id: `\$Rqnc-F-dvnEYJTyHq_iKxU2bZ1CI92-kuZq3a5lr5Zg`."
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,5 +31,5 @@ enum class BackupState {
|
|||
RESUMING,
|
||||
ENABLED,
|
||||
DOWNLOADING,
|
||||
DISABLING;
|
||||
DISABLING
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ interface NotificationSettingsService {
|
|||
/**
|
||||
* State of the current room notification settings flow ([MatrixRoomNotificationSettingsState.Unknown] if not started).
|
||||
*/
|
||||
val notificationSettingsChangeFlow : SharedFlow<Unit>
|
||||
val notificationSettingsChangeFlow: SharedFlow<Unit>
|
||||
suspend fun getRoomNotificationSettings(roomId: RoomId, isEncrypted: Boolean, isOneToOne: Boolean): Result<RoomNotificationSettings>
|
||||
suspend fun getDefaultRoomNotificationMode(isEncrypted: Boolean, isOneToOne: Boolean): Result<RoomNotificationMode>
|
||||
suspend fun setDefaultRoomNotificationMode(isEncrypted: Boolean, mode: RoomNotificationMode, isOneToOne: Boolean): Result<Unit>
|
||||
|
|
|
|||
|
|
@ -130,7 +130,9 @@ object PermalinkParser {
|
|||
val splitNameValue = it.split("=")
|
||||
if (splitNameValue.size == 2) {
|
||||
Pair(splitNameValue[0], URLDecoder.decode(splitNameValue[1], "UTF-8"))
|
||||
} else null
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
private fun String.getViaParameters(): List<String> {
|
||||
|
|
|
|||
|
|
@ -35,5 +35,3 @@ fun MatrixRoomMembersState.roomMembers(): List<RoomMember>? {
|
|||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import io.element.android.libraries.matrix.api.core.RoomId
|
|||
import io.element.android.libraries.matrix.api.core.UserId
|
||||
|
||||
sealed interface Mention {
|
||||
data class User(val userId: UserId): Mention
|
||||
data object AtRoom: Mention
|
||||
data class Room(val roomId: RoomId?, val roomAlias: String?): Mention
|
||||
data class User(val userId: UserId) : Mention
|
||||
data object AtRoom : Mention
|
||||
data class Room(val roomId: RoomId?, val roomAlias: String?) : Mention
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,5 +38,5 @@ enum class StateEventType {
|
|||
ROOM_TOMBSTONE,
|
||||
ROOM_TOPIC,
|
||||
SPACE_CHILD,
|
||||
SPACE_PARENT;
|
||||
SPACE_PARENT
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,4 +39,3 @@ suspend fun MatrixRoom.canSendMessage(type: MessageEventType): Result<Boolean> =
|
|||
* Shortcut for calling [MatrixRoom.canUserRedact] with our own user.
|
||||
*/
|
||||
suspend fun MatrixRoom.canRedact(): Result<Boolean> = canUserRedact(sessionId)
|
||||
|
||||
|
|
|
|||
|
|
@ -30,4 +30,3 @@ sealed interface MatrixTimelineItem {
|
|||
data class Virtual(val uniqueId: String, val virtual: VirtualTimelineItem) : MatrixTimelineItem
|
||||
data object Other : MatrixTimelineItem
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,5 +19,5 @@ package io.element.android.libraries.matrix.api.timeline
|
|||
enum class ReceiptType {
|
||||
READ,
|
||||
READ_PRIVATE,
|
||||
FULLY_READ;
|
||||
FULLY_READ
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,12 +88,12 @@ object EventType {
|
|||
|
||||
fun isCallEvent(type: String): Boolean {
|
||||
return type == CALL_INVITE ||
|
||||
type == CALL_CANDIDATES ||
|
||||
type == CALL_ANSWER ||
|
||||
type == CALL_HANGUP ||
|
||||
type == CALL_SELECT_ANSWER ||
|
||||
type == CALL_NEGOTIATE ||
|
||||
type == CALL_REJECT ||
|
||||
type == CALL_REPLACES
|
||||
type == CALL_CANDIDATES ||
|
||||
type == CALL_ANSWER ||
|
||||
type == CALL_HANGUP ||
|
||||
type == CALL_SELECT_ANSWER ||
|
||||
type == CALL_NEGOTIATE ||
|
||||
type == CALL_REJECT ||
|
||||
type == CALL_REPLACES
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,5 +33,5 @@ enum class MembershipChange {
|
|||
KNOCK_ACCEPTED,
|
||||
KNOCK_RETRACTED,
|
||||
KNOCK_DENIED,
|
||||
NOT_IMPLEMENTED;
|
||||
NOT_IMPLEMENTED
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,4 +28,3 @@ data class ReactionSender(
|
|||
val senderId: UserId,
|
||||
val timestamp: Long
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -17,5 +17,5 @@
|
|||
package io.element.android.libraries.matrix.api.timeline.item.event
|
||||
|
||||
enum class TimelineItemEventOrigin {
|
||||
LOCAL, SYNC, PAGINATION;
|
||||
LOCAL, SYNC, PAGINATION
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,5 +44,4 @@ class AuthErrorCodeTest {
|
|||
val error = AuthenticationException.Generic("Some other error")
|
||||
assertThat(error.errorCode).isEqualTo(AuthErrorCode.UNKNOWN)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,5 +54,4 @@ class MatrixToConverterTest {
|
|||
val url = Uri.parse("https://element.io/")
|
||||
assertThat(MatrixToConverter.convert(url)).isNull()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@ class PermalinkDataTest {
|
|||
@Test
|
||||
fun `getRoomId() returns value when isRoomAlias is false`() {
|
||||
val permalinkData = PermalinkData.RoomLink(
|
||||
roomIdOrAlias = "!abcdef123456:matrix.org",
|
||||
isRoomAlias = false,
|
||||
eventId = null,
|
||||
viaParameters = persistentListOf(),
|
||||
roomIdOrAlias = "!abcdef123456:matrix.org",
|
||||
isRoomAlias = false,
|
||||
eventId = null,
|
||||
viaParameters = persistentListOf(),
|
||||
)
|
||||
assertThat(permalinkData.getRoomId()).isNotNull()
|
||||
assertThat(permalinkData.getRoomAlias()).isNull()
|
||||
|
|
@ -45,5 +45,4 @@ class PermalinkDataTest {
|
|||
assertThat(permalinkData.getRoomId()).isNull()
|
||||
assertThat(permalinkData.getRoomAlias()).isNotNull()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,9 +53,9 @@ class PermalinkParserTest {
|
|||
fun `parsing a valid user url returns a user link`() {
|
||||
val url = "https://app.element.io/#/user/@test:matrix.org"
|
||||
assertThat(PermalinkParser.parse(url)).isEqualTo(
|
||||
PermalinkData.UserLink(
|
||||
userId = "@test:matrix.org"
|
||||
)
|
||||
PermalinkData.UserLink(
|
||||
userId = "@test:matrix.org"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -115,12 +115,12 @@ class PermalinkParserTest {
|
|||
fun `parsing a valid room alias url returns a room link`() {
|
||||
val url = "https://app.element.io/#/room/#element-android:matrix.org"
|
||||
assertThat(PermalinkParser.parse(url)).isEqualTo(
|
||||
PermalinkData.RoomLink(
|
||||
roomIdOrAlias = "#element-android:matrix.org",
|
||||
isRoomAlias = true,
|
||||
eventId = null,
|
||||
viaParameters = persistentListOf(),
|
||||
)
|
||||
PermalinkData.RoomLink(
|
||||
roomIdOrAlias = "#element-android:matrix.org",
|
||||
isRoomAlias = true,
|
||||
eventId = null,
|
||||
viaParameters = persistentListOf(),
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue