Merge pull request #5852 from element-hq/renovate/io.nlopez.compose.rules-detekt-0.x

fix(deps): update dependency io.nlopez.compose.rules:detekt to v0.5.1
This commit is contained in:
Benoit Marty 2025-12-08 15:05:12 +01:00 committed by GitHub
commit 4cfd8907dd
18 changed files with 23 additions and 40 deletions

View file

@ -46,7 +46,7 @@ allprojects {
config.from(files("$rootDir/tools/detekt/detekt.yml")) config.from(files("$rootDir/tools/detekt/detekt.yml"))
} }
dependencies { dependencies {
detektPlugins("io.nlopez.compose.rules:detekt:0.4.28") detektPlugins("io.nlopez.compose.rules:detekt:0.5.1")
detektPlugins(project(":tests:detekt-rules")) detektPlugins(project(":tests:detekt-rules"))
} }

View file

@ -71,7 +71,7 @@ class DefaultPinCodeManager(
lockScreenStore.onWrongPin() lockScreenStore.onWrongPin()
} }
} }
} catch (failure: Throwable) { } catch (_: Throwable) {
false false
} }
} }

View file

@ -112,7 +112,7 @@ fun EventDebugInfoView(
private fun prettyJSON(maybeJSON: String): String { private fun prettyJSON(maybeJSON: String): String {
return try { return try {
JSONObject(maybeJSON).toString(2) JSONObject(maybeJSON).toString(2)
} catch (e: JSONException) { } catch (_: JSONException) {
// Prefer not pretty-printing over crashing if the data is not actually JSON // Prefer not pretty-printing over crashing if the data is not actually JSON
maybeJSON maybeJSON
} }

View file

@ -60,7 +60,7 @@ fun Activity.openUrlInChromeCustomTab(
}) })
} }
.launchUrl(this, url.toUri()) .launchUrl(this, url.toUri())
} catch (activityNotFoundException: ActivityNotFoundException) { } catch (_: ActivityNotFoundException) {
openUrlInExternalApp(url) openUrlInExternalApp(url)
} }
} }

View file

@ -20,7 +20,7 @@ fun String.hash() = try {
digest.digest() digest.digest()
.joinToString("") { String.format(Locale.ROOT, "%02X", it) } .joinToString("") { String.format(Locale.ROOT, "%02X", it) }
.lowercase(Locale.ROOT) .lowercase(Locale.ROOT)
} catch (exc: Exception) { } catch (_: Exception) {
// Should not happen, but just in case // Should not happen, but just in case
hashCode().toString() hashCode().toString()
} }

View file

@ -32,7 +32,7 @@ fun Context.getApplicationLabel(packageName: String): String {
return try { return try {
val ai = packageManager.getApplicationInfoCompat(packageName, 0) val ai = packageManager.getApplicationInfoCompat(packageName, 0)
packageManager.getApplicationLabel(ai).toString() packageManager.getApplicationLabel(ai).toString()
} catch (e: PackageManager.NameNotFoundException) { } catch (_: PackageManager.NameNotFoundException) {
packageName packageName
} }
} }
@ -96,7 +96,7 @@ fun Context.startNotificationSettingsIntent(
} else { } else {
startActivity(intent) startActivity(intent)
} }
} catch (activityNotFoundException: ActivityNotFoundException) { } catch (_: ActivityNotFoundException) {
toast(noActivityFoundMessage) toast(noActivityFoundMessage)
} }
} }
@ -112,7 +112,7 @@ fun Context.openAppSettingsPage(
data = Uri.fromParts("package", packageName, null) data = Uri.fromParts("package", packageName, null)
} }
) )
} catch (activityNotFoundException: ActivityNotFoundException) { } catch (_: ActivityNotFoundException) {
toast(noActivityFoundMessage) toast(noActivityFoundMessage)
} }
} }
@ -126,7 +126,7 @@ fun Context.startInstallFromSourceIntent(
.setData("package:$packageName".toUri()) .setData("package:$packageName".toUri())
try { try {
activityResultLauncher.launch(intent) activityResultLauncher.launch(intent)
} catch (activityNotFoundException: ActivityNotFoundException) { } catch (_: ActivityNotFoundException) {
toast(noActivityFoundMessage) toast(noActivityFoundMessage)
} }
} }
@ -157,7 +157,7 @@ fun Context.startSharePlainTextIntent(
} else { } else {
startActivity(intent) startActivity(intent)
} }
} catch (activityNotFoundException: ActivityNotFoundException) { } catch (_: ActivityNotFoundException) {
toast(noActivityFoundMessage) toast(noActivityFoundMessage)
} }
} }

View file

@ -21,7 +21,7 @@ fun String.md5() = try {
digest.digest() digest.digest()
.joinToString("") { String.format(locale, "%02X", it) } .joinToString("") { String.format(locale, "%02X", it) }
.lowercase(locale) .lowercase(locale)
} catch (exc: Exception) { } catch (_: Exception) {
// Should not happen, but just in case // Should not happen, but just in case
hashCode().toString() hashCode().toString()
} }

View file

@ -14,7 +14,7 @@ fun String.isValidUrl(): Boolean {
return try { return try {
URI(this).toURL() URI(this).toURL()
true true
} catch (t: Throwable) { } catch (_: Throwable) {
false false
} }
} }

View file

@ -88,7 +88,7 @@ class FullScreenIntentPermissionsPresenter(
"package:${buildMeta.applicationId}".toUri() "package:${buildMeta.applicationId}".toUri()
) )
externalIntentLauncher.launch(intent) externalIntentLauncher.launch(intent)
} catch (e: ActivityNotFoundException) { } catch (_: ActivityNotFoundException) {
val intent = Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS) val intent = Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS)
.putExtra(Settings.EXTRA_APP_PACKAGE, buildMeta.applicationId) .putExtra(Settings.EXTRA_APP_PACKAGE, buildMeta.applicationId)
externalIntentLauncher.launch(intent) externalIntentLauncher.launch(intent)

View file

@ -65,7 +65,7 @@ suspend fun RoomList.awaitLoaded(timeout: Duration = Duration.INFINITE) {
it is RoomList.LoadingState.Loaded it is RoomList.LoadingState.Loaded
} }
} }
} catch (timeoutException: TimeoutCancellationException) { } catch (_: TimeoutCancellationException) {
Timber.d("awaitAllRoomsAreLoaded: no response after $timeout") Timber.d("awaitAllRoomsAreLoaded: no response after $timeout")
} }
} }

View file

@ -34,7 +34,7 @@ class RoomSyncSubscriber(
} }
subscribedRoomIds.add(roomId) subscribedRoomIds.add(roomId)
} catch (exception: Exception) { } catch (exception: Exception) {
Timber.e("Failed to subscribe to room $roomId") Timber.e(exception, "Failed to subscribe to room $roomId")
} }
} }
} }

View file

@ -48,7 +48,7 @@ fun RoomListInterface.loadingStateFlow(): Flow<RoomListLoadingState> =
try { try {
send(result.state) send(result.state)
} catch (exception: Exception) { } catch (exception: Exception) {
Timber.d("loadingStateFlow() initialState failed.") Timber.d(exception, "loadingStateFlow() initialState failed.")
} }
result.stateStream result.stateStream
}.catch { }.catch {

View file

@ -14,10 +14,10 @@ import timber.log.Timber
fun logError(throwable: Throwable) { fun logError(throwable: Throwable) {
when (throwable) { when (throwable) {
is ClientException.Generic -> { is ClientException.Generic -> {
Timber.e("Error ${throwable.msg}", throwable) Timber.e(throwable, "Error ${throwable.msg}")
} }
else -> { else -> {
Timber.e("Error", throwable) Timber.e(throwable, "Error")
} }
} }
} }

View file

@ -62,7 +62,7 @@ class RustWidgetDriver(
override suspend fun send(message: String) { override suspend fun send(message: String) {
try { try {
driverAndHandle.handle.send(message) driverAndHandle.handle.send(message)
} catch (e: IllegalStateException) { } catch (_: IllegalStateException) {
// The handle is closed, ignore // The handle is closed, ignore
} }
} }

View file

@ -56,7 +56,7 @@ class PushLoopbackTest(
} }
val testPushResult = try { val testPushResult = try {
pushService.testPush(sessionId) pushService.testPush(sessionId)
} catch (pusherRejected: PushGatewayFailure.PusherRejected) { } catch (_: PushGatewayFailure.PusherRejected) {
val hasQuickFix = pushService.getCurrentPushProvider(sessionId)?.canRotateToken() == true val hasQuickFix = pushService.getCurrentPushProvider(sessionId)?.canRotateToken() == true
delegate.updateState( delegate.updateState(
description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_1), description = stringProvider.getString(R.string.troubleshoot_notifications_test_push_loop_back_failure_1),

View file

@ -40,7 +40,7 @@ class SharedPreferencesFirebaseStore(
if (k == PREFS_KEY_FCM_TOKEN) { if (k == PREFS_KEY_FCM_TOKEN) {
try { try {
flow.value = getFcmToken() flow.value = getFcmToken()
} catch (e: Exception) { } catch (_: Exception) {
flow.value = null flow.value = null
} }
} }

View file

@ -34,7 +34,7 @@ suspend fun awaitWithLatch(timeout: Duration = 300.milliseconds, block: (Complet
withTimeout(timeout) { withTimeout(timeout) {
latch.also(block).await() latch.also(block).await()
} }
} catch (exception: TimeoutCancellationException) { } catch (_: TimeoutCancellationException) {
latch.complete(Unit) latch.complete(Unit)
} }
} }

View file

@ -150,7 +150,7 @@ exceptions:
TooGenericExceptionCaught: TooGenericExceptionCaught:
active: false active: false
SwallowedException: SwallowedException:
active: false active: true
ThrowingExceptionsWithoutMessageOrCause: ThrowingExceptionsWithoutMessageOrCause:
active: true active: true
TooGenericExceptionThrown: TooGenericExceptionThrown:
@ -224,27 +224,12 @@ comments:
Compose: Compose:
CompositionLocalAllowlist: CompositionLocalAllowlist:
active: true active: true
# You can optionally define a list of CompositionLocals that are allowed here
allowedCompositionLocals:
- LocalCompoundColors
- LocalSnackbarDispatcher
- LocalCameraPositionState
- LocalMediaItemPresenterFactories
- LocalTimelineItemPresenterFactories
- LocalRoomMemberProfilesCache
- LocalMentionSpanUpdater
- LocalAnalyticsService
- LocalBuildMeta
- LocalUiTestMode
- LocalSdkIntVersionProvider
CompositionLocalNaming: CompositionLocalNaming:
active: true active: true
ContentEmitterReturningValues: ContentEmitterReturningValues:
active: true active: true
# You can optionally add your own composables here # You can optionally add your own composables here
# contentEmitters: MyComposable,MyOtherComposable # contentEmitters: MyComposable,MyOtherComposable
ModifierComposable:
active: true
ModifierMissing: ModifierMissing:
active: true active: true
ModifierReused: ModifierReused:
@ -267,8 +252,6 @@ Compose:
active: true active: true
PreviewPublic: PreviewPublic:
active: true active: true
# You can optionally disable that only previews with @PreviewParameter are flagged
previewPublicOnlyIfParams: false
RememberMissing: RememberMissing:
active: true active: true
UnstableCollections: UnstableCollections: