Fix moar ktlint issues

This commit is contained in:
Benoit Marty
2024-01-11 09:41:14 +01:00
committed by Benoit Marty
parent d3830af78b
commit 378692f743
528 changed files with 146 additions and 629 deletions

View File

@@ -28,7 +28,6 @@ class FakeAnalyticsService(
isEnabled: Boolean = false,
didAskUserConsent: Boolean = false
) : AnalyticsService {
private val isEnabledFlow = MutableStateFlow(isEnabled)
private val didAskUserConsentFlow = MutableStateFlow(didAskUserConsent)
val capturedEvents = mutableListOf<VectorAnalyticsEvent>()

View File

@@ -38,13 +38,13 @@ class SentryAnalyticsProvider @Inject constructor(
@ApplicationContext private val context: Context,
private val buildMeta: BuildMeta,
) : AnalyticsProvider {
override val name = SentryConfig.name
override val name = SentryConfig.NAME
override fun init() {
Timber.tag(analyticsTag.value).d("Initializing Sentry")
if (Sentry.isEnabled()) return
SentryAndroid.init(context) { options ->
options.dsn = SentryConfig.dns
options.dsn = SentryConfig.DNS
options.beforeSend = SentryOptions.BeforeSendCallback { event, _ -> event }
options.tracesSampleRate = 1.0
options.isEnableUserInteractionTracing = true
@@ -73,7 +73,7 @@ class SentryAnalyticsProvider @Inject constructor(
}
private fun BuildType.toSentryEnv() = when (this) {
BuildType.RELEASE -> SentryConfig.envRelease
BuildType.RELEASE -> SentryConfig.ENV_RELEASE
BuildType.NIGHTLY,
BuildType.DEBUG -> SentryConfig.envDebug
BuildType.DEBUG -> SentryConfig.ENV_DEBUG
}

View File

@@ -17,8 +17,8 @@
package io.element.android.services.analyticsproviders.sentry
object SentryConfig {
const val name = "Sentry"
const val dns = "https://32f7ff6a6e724f90838b7654042b2e81@sentry.tools.element.io/59"
const val envDebug = "DEBUG"
const val envRelease = "RELEASE"
const val NAME = "Sentry"
const val DNS = "https://32f7ff6a6e724f90838b7654042b2e81@sentry.tools.element.io/59"
const val ENV_DEBUG = "DEBUG"
const val ENV_RELEASE = "RELEASE"
}

View File

@@ -19,7 +19,6 @@ package io.element.android.services.apperror.api
import kotlinx.coroutines.flow.StateFlow
interface AppErrorStateService {
val appErrorStateFlow: StateFlow<AppErrorState>
fun showError(title: String, body: String)

View File

@@ -28,7 +28,6 @@ import javax.inject.Inject
@ContributesBinding(AppScope::class)
@SingleIn(AppScope::class)
class DefaultAppErrorStateService @Inject constructor() : AppErrorStateService {
private val currentAppErrorState = MutableStateFlow<AppErrorState>(AppErrorState.NoError)
override val appErrorStateFlow: StateFlow<AppErrorState> = currentAppErrorState

View File

@@ -23,7 +23,6 @@ import kotlinx.coroutines.test.runTest
import org.junit.Test
internal class DefaultAppErrorStateServiceTest {
@Test
fun `initial value is no error`() = runTest {
val service = DefaultAppErrorStateService()

View File

@@ -24,7 +24,6 @@ import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
class DefaultAppForegroundStateService : AppForegroundStateService {
private val state = MutableStateFlow(false)
override val isInForeground: StateFlow<Boolean> = state

View File

@@ -47,7 +47,6 @@ class DefaultAppNavigationStateService @Inject constructor(
private val appForegroundStateService: AppForegroundStateService,
private val coroutineScope: CoroutineScope,
) : AppNavigationStateService {
private val state = MutableStateFlow(
AppNavigationState(
navigationState = NavigationState.Root,

View File

@@ -29,7 +29,6 @@ import io.element.android.services.appnavstate.impl.initializer.AppForegroundSta
@Module
@ContributesTo(AppScope::class)
object AppNavStateModule {
@Provides
fun provideAppForegroundStateService(
@ApplicationContext context: Context

View File

@@ -23,7 +23,6 @@ import kotlinx.coroutines.flow.StateFlow
class FakeAppForegroundStateService(
initialValue: Boolean = true,
) : AppForegroundStateService {
private val state = MutableStateFlow(initialValue)
override val isInForeground: StateFlow<Boolean> = state

View File

@@ -23,7 +23,6 @@ import javax.inject.Inject
@ContributesBinding(AppScope::class)
class DefaultSystemClock @Inject constructor() : SystemClock {
/**
* Provides a UTC epoch in milliseconds
*