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:
renovate[bot] 2024-01-10 16:22:24 +01:00 committed by GitHub
parent 675cc525cf
commit 7e9cda3aa9
442 changed files with 1091 additions and 1081 deletions

View file

@ -28,7 +28,6 @@ import javax.inject.Inject
@ContributesBinding(AppScope::class)
class DefaultBugReportEntryPoint @Inject constructor() : BugReportEntryPoint {
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): BugReportEntryPoint.NodeBuilder {
val plugins = ArrayList<Plugin>()
return object : BugReportEntryPoint.NodeBuilder {

View file

@ -20,10 +20,10 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.rememberCoroutineScope
import com.squareup.anvil.annotations.ContributesBinding
import io.element.android.features.rageshake.api.crash.CrashDataStore
import io.element.android.features.rageshake.api.crash.CrashDetectionEvents
import io.element.android.features.rageshake.api.crash.CrashDetectionPresenter
import io.element.android.features.rageshake.api.crash.CrashDetectionState
import io.element.android.features.rageshake.api.crash.CrashDataStore
import io.element.android.libraries.di.AppScope
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch

View file

@ -82,7 +82,7 @@ class VectorFileLogger(
init {
for (i in 0..15) {
val file = File(cacheDirectory, "elementLogs.${i}.txt")
val file = File(cacheDirectory, "elementLogs.$i.txt")
file.safeDelete()
}
@ -144,7 +144,7 @@ class VectorFileLogger(
?.flush()
?.let { 0 until logRotationCount }
?.mapNotNull { index ->
File(cacheDirectory, "$fileNamePrefix.${index}.txt")
File(cacheDirectory, "$fileNamePrefix.$index.txt")
.takeIf { it.exists() }
}
}

View file

@ -88,6 +88,7 @@ class DefaultBugReporter @Inject constructor(
// the pending bug report call
private var bugReportCall: Call? = null
// boolean to cancel the bug report
private val isCancelled = false
private val logcatCommandDebug = arrayOf("logcat", "-d", "-v", "threadtime", "*:*")
@ -187,7 +188,8 @@ class DefaultBugReporter @Inject constructor(
try {
builder.addFormDataPart(
"file",
screenshotFile.name, screenshotFile.asRequestBody(MimeTypes.OctetStream.toMediaTypeOrNull())
screenshotFile.name,
screenshotFile.asRequestBody(MimeTypes.OctetStream.toMediaTypeOrNull())
)
} catch (e: Exception) {
Timber.e(e, "## sendBugReport() : fail to write screenshot")

View file

@ -58,7 +58,6 @@ class CrashDetectionPresenterTest {
skipItems(1)
val initialState = awaitItem()
assertThat(initialState.crashDetected).isTrue()
}
}