Enable detekt rules AlsoCouldBeApply and fix existing issues.
This commit is contained in:
committed by
Benoit Marty
parent
1d3aa2cd05
commit
d433c3cbaa
@@ -41,8 +41,7 @@ class CustomTabHandler @Inject constructor(
|
||||
if (packageName != null) {
|
||||
customTabsServiceConnection = object : CustomTabsServiceConnection() {
|
||||
override fun onCustomTabsServiceConnected(name: ComponentName, client: CustomTabsClient) {
|
||||
customTabsClient = client
|
||||
.also { it.warmup(0L) }
|
||||
customTabsClient = client.apply { warmup(0L) }
|
||||
prefetchUrl(url)
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ class DefaultLastMessageTimestampFormatterTest {
|
||||
* Create DefaultLastMessageFormatter and set current time to the provided date.
|
||||
*/
|
||||
private fun createFormatter(@Suppress("SameParameterValue") currentDate: String): LastMessageTimestampFormatter {
|
||||
val clock = FakeClock().also { it.givenInstant(Instant.parse(currentDate)) }
|
||||
val clock = FakeClock().apply { givenInstant(Instant.parse(currentDate)) }
|
||||
val localDateTimeProvider = LocalDateTimeProvider(clock, TimeZone.UTC)
|
||||
val dateFormatters = DateFormatters(Locale.US, clock, TimeZone.UTC)
|
||||
return DefaultLastMessageTimestampFormatter(localDateTimeProvider, dateFormatters)
|
||||
|
||||
@@ -20,19 +20,16 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
||||
|
||||
open class AvatarDataProvider : PreviewParameterProvider<AvatarData> {
|
||||
override val values: Sequence<AvatarData>
|
||||
get() {
|
||||
AvatarSize.values()
|
||||
.also { it.sortBy { item -> item.name } }
|
||||
.asSequence()
|
||||
return AvatarSize.values().asSequence().map {
|
||||
get() = AvatarSize.values()
|
||||
.asSequence()
|
||||
.map {
|
||||
sequenceOf(
|
||||
anAvatarData(size = it),
|
||||
anAvatarData(size = it).copy(name = null),
|
||||
anAvatarData(size = it).copy(url = "aUrl"),
|
||||
)
|
||||
}
|
||||
.flatten()
|
||||
}
|
||||
.flatten()
|
||||
}
|
||||
|
||||
fun anAvatarData(
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# Default rules: https://github.com/detekt/detekt/blob/main/detekt-core/src/main/resources/default-detekt-config.yml
|
||||
|
||||
style:
|
||||
AlsoCouldBeApply:
|
||||
active: true
|
||||
CascadingCallWrapping:
|
||||
active: true
|
||||
includeElvis: true
|
||||
|
||||
Reference in New Issue
Block a user