Fix ktlint issues

This commit is contained in:
Benoit Marty
2024-01-10 19:33:39 +01:00
parent 246c33589a
commit d3830af78b
100 changed files with 66 additions and 158 deletions

View File

@@ -21,7 +21,6 @@ package io.element.android.libraries.core.cache
* This class is not thread safe.
*/
class CircularCache<T : Any>(cacheSize: Int, factory: (Int) -> Array<T?>) {
companion object {
inline fun <reified T : Any> create(cacheSize: Int) = CircularCache(cacheSize) { Array<T?>(cacheSize) { null } }
}

View File

@@ -26,20 +26,6 @@ inline fun <T> T.ooi(block: (T) -> Unit): T = also(block)
*/
fun CharSequence?.orEmpty() = this ?: ""
/**
* Check if a CharSequence is a phone number.
*/
/*
fun CharSequence.isMsisdn(): Boolean {
return try {
PhoneNumberUtil.getInstance().parse(ensurePrefix("+"), null)
true
} catch (e: NumberParseException) {
false
}
}
*/
/**
* Useful to append a String at the end of a filename but before the extension if any
* Ex:

View File

@@ -23,7 +23,6 @@ package io.element.android.libraries.core.log.logger
* Timber.tag(loggerTag.value).v("My log message")
*/
open class LoggerTag(name: String, parentTag: LoggerTag? = null) {
object PushLoggerTag : LoggerTag("Push")
object NotificationLoggerTag : LoggerTag("Notification", PushLoggerTag)

View File

@@ -20,7 +20,6 @@ import org.junit.Assert.assertEquals
import org.junit.Test
class BasicExtensionsTest {
@Test(expected = IllegalArgumentException::class)
fun `test ellipsize at 0`() {
"1234567890".ellipsize(0)

View File

@@ -20,7 +20,6 @@ import com.google.common.truth.Truth.assertThat
import org.junit.Test
class ResultTest {
@Test
fun testFlatMap() {
val initial = Result.success("initial")