From bb80453bf8008766efa688223958f3d1b078039e Mon Sep 17 00:00:00 2001 From: Nek-12 Date: Sun, 8 Dec 2024 14:12:31 +0100 Subject: [PATCH] chore: fix lint --- benchmarks/build.gradle.kts | 3 +-- .../pro/respawn/flowmvi/benchmarks/setup/fluxo/FluxoStore.kt | 3 +-- build.gradle.kts | 2 -- buildSrc/src/main/kotlin/ConfigureMultiplatform.kt | 2 +- core/src/commonMain/kotlin/pro/respawn/flowmvi/api/Store.kt | 1 - .../kotlin/pro/respawn/flowmvi/debugger/model/ClientEvent.kt | 1 - .../kotlin/pro/respawn/flowmvi/debugger/model/ServerEvent.kt | 2 +- debugger/ideplugin/build.gradle.kts | 2 ++ debugger/server/build.gradle.kts | 2 -- .../pro/respawn/flowmvi/debugger/server/DebugServerContract.kt | 2 +- .../pro/respawn/flowmvi/debugger/server/DebugServerStore.kt | 2 +- .../respawn/flowmvi/debugger/server/navigation/AppNavigator.kt | 2 +- .../flowmvi/debugger/server/navigation/AppNavigatorImpl.kt | 2 +- .../debugger/server/navigation/destination/Destination.kt | 3 +-- .../server/ui/screens/storedetails/StoreDetailsContainer.kt | 2 +- .../server/ui/screens/storedetails/StoreDetailsContract.kt | 2 +- .../server/ui/screens/storedetails/StoreDetailsScreen.kt | 2 +- .../debugger/server/ui/screens/timeline/TimelineContract.kt | 2 +- .../kotlin/pro/respawn/flowmvi/metrics/P2QuantileEstimator.kt | 2 +- .../flowmvi/sample/navigation/destination/Destination.kt | 1 - .../pro/respawn/flowmvi/savedstate/plugins/SavedStatePlugin.kt | 1 - settings.gradle.kts | 2 +- .../pro/respawn/flowmvi/test/plugin/TestPipelineContext.kt | 1 - 23 files changed, 17 insertions(+), 27 deletions(-) diff --git a/benchmarks/build.gradle.kts b/benchmarks/build.gradle.kts index 85fd4b94..3d9a0100 100644 --- a/benchmarks/build.gradle.kts +++ b/benchmarks/build.gradle.kts @@ -1,4 +1,4 @@ -import configureMultiplatform + import kotlinx.benchmark.gradle.JvmBenchmarkTarget import kotlinx.benchmark.gradle.benchmark @@ -26,7 +26,6 @@ kotlin { windows = false, wasmJs = false, ) - } tasks.withType().configureEach { jvmArgs("-Dkotlinx.coroutines.debug=off") diff --git a/benchmarks/src/jvmMain/kotlin/pro/respawn/flowmvi/benchmarks/setup/fluxo/FluxoStore.kt b/benchmarks/src/jvmMain/kotlin/pro/respawn/flowmvi/benchmarks/setup/fluxo/FluxoStore.kt index fbc1c66d..7e98509d 100644 --- a/benchmarks/src/jvmMain/kotlin/pro/respawn/flowmvi/benchmarks/setup/fluxo/FluxoStore.kt +++ b/benchmarks/src/jvmMain/kotlin/pro/respawn/flowmvi/benchmarks/setup/fluxo/FluxoStore.kt @@ -7,8 +7,7 @@ import pro.respawn.flowmvi.benchmarks.setup.BenchmarkIntent import pro.respawn.flowmvi.benchmarks.setup.BenchmarkState @OptIn(ExperimentalFluxoApi::class) -internal inline fun fluxoStore( -) = store(BenchmarkState(), reducer = { it: BenchmarkIntent -> +internal inline fun fluxoStore() = store(BenchmarkState(), reducer = { it: BenchmarkIntent -> when (it) { BenchmarkIntent.Increment -> copy(counter = counter + 1) } diff --git a/build.gradle.kts b/build.gradle.kts index 27fe5c7d..51cb96ef 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -142,8 +142,6 @@ versionCatalogUpdate { } } - - tasks { withType().configureEach { buildUponDefaultConfig = true diff --git a/buildSrc/src/main/kotlin/ConfigureMultiplatform.kt b/buildSrc/src/main/kotlin/ConfigureMultiplatform.kt index 771ca2ec..e776a581 100644 --- a/buildSrc/src/main/kotlin/ConfigureMultiplatform.kt +++ b/buildSrc/src/main/kotlin/ConfigureMultiplatform.kt @@ -26,7 +26,7 @@ fun Project.configureMultiplatform( configure: KotlinHierarchyBuilder.Root.() -> Unit = {}, ) = ext.apply { val libs by versionCatalog - if(explicitApi) explicitApi() + if (explicitApi) explicitApi() applyDefaultHierarchyTemplate(configure) withSourcesJar(true) compilerOptions { diff --git a/core/src/commonMain/kotlin/pro/respawn/flowmvi/api/Store.kt b/core/src/commonMain/kotlin/pro/respawn/flowmvi/api/Store.kt index 358d68e4..8bf247bb 100644 --- a/core/src/commonMain/kotlin/pro/respawn/flowmvi/api/Store.kt +++ b/core/src/commonMain/kotlin/pro/respawn/flowmvi/api/Store.kt @@ -20,5 +20,4 @@ public interface Store : // override with a mutable return type override fun start(scope: CoroutineScope): StoreLifecycle - } diff --git a/debugger/debugger-common/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/model/ClientEvent.kt b/debugger/debugger-common/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/model/ClientEvent.kt index dffe41af..abbb2a89 100644 --- a/debugger/debugger-common/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/model/ClientEvent.kt +++ b/debugger/debugger-common/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/model/ClientEvent.kt @@ -4,7 +4,6 @@ package pro.respawn.flowmvi.debugger.model import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable -import kotlinx.serialization.UseSerializers import pro.respawn.flowmvi.api.MVIAction import pro.respawn.flowmvi.api.MVIIntent import pro.respawn.flowmvi.api.MVIState diff --git a/debugger/debugger-common/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/model/ServerEvent.kt b/debugger/debugger-common/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/model/ServerEvent.kt index ce79c802..9e2f5ef9 100644 --- a/debugger/debugger-common/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/model/ServerEvent.kt +++ b/debugger/debugger-common/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/model/ServerEvent.kt @@ -2,10 +2,10 @@ package pro.respawn.flowmvi.debugger.model -import kotlin.uuid.Uuid import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import pro.respawn.flowmvi.api.MVIAction +import kotlin.uuid.Uuid @Serializable @SerialName("ServerEvent") diff --git a/debugger/ideplugin/build.gradle.kts b/debugger/ideplugin/build.gradle.kts index 29aa032f..fec2162c 100644 --- a/debugger/ideplugin/build.gradle.kts +++ b/debugger/ideplugin/build.gradle.kts @@ -34,6 +34,7 @@ intellijPlatform { } publishing { token = props["plugin.publishing.token"]?.toString() + hidden = true } pluginConfiguration { ideaVersion { @@ -49,6 +50,7 @@ intellijPlatform { description = Config.Plugin.description name = Config.Plugin.name version = Config.versionName + changeNotes = System.getenv("CHANGELOG") } } diff --git a/debugger/server/build.gradle.kts b/debugger/server/build.gradle.kts index ccb2dbea..b34759ca 100644 --- a/debugger/server/build.gradle.kts +++ b/debugger/server/build.gradle.kts @@ -1,5 +1,3 @@ -import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi - plugins { id(libs.plugins.kotlin.multiplatform.id) alias(libs.plugins.compose) diff --git a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/DebugServerContract.kt b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/DebugServerContract.kt index 071c68f0..12348d8f 100644 --- a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/DebugServerContract.kt +++ b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/DebugServerContract.kt @@ -1,7 +1,6 @@ package pro.respawn.flowmvi.debugger.server import androidx.compose.runtime.Immutable -import kotlin.uuid.Uuid import kotlinx.collections.immutable.PersistentList import kotlinx.collections.immutable.PersistentMap import kotlinx.collections.immutable.persistentListOf @@ -13,6 +12,7 @@ import pro.respawn.flowmvi.api.MVIIntent import pro.respawn.flowmvi.api.MVIState import pro.respawn.flowmvi.debugger.model.ClientEvent import pro.respawn.flowmvi.debugger.model.ServerEvent +import kotlin.uuid.Uuid internal enum class StoreCommand { Stop, ResendIntent, RollbackState, ResendAction, RethrowException, SetInitialState diff --git a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/DebugServerStore.kt b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/DebugServerStore.kt index 2795e940..a5dd8380 100644 --- a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/DebugServerStore.kt +++ b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/DebugServerStore.kt @@ -1,6 +1,5 @@ package pro.respawn.flowmvi.debugger.server -import kotlin.uuid.Uuid import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.toPersistentList import kotlinx.coroutines.Dispatchers @@ -26,6 +25,7 @@ import pro.respawn.flowmvi.dsl.updateStateImmediate import pro.respawn.flowmvi.plugins.enableLogging import pro.respawn.flowmvi.plugins.recover import pro.respawn.flowmvi.plugins.reduce +import kotlin.uuid.Uuid import pro.respawn.flowmvi.debugger.server.ServerAction as Action import pro.respawn.flowmvi.debugger.server.ServerIntent as Intent import pro.respawn.flowmvi.debugger.server.ServerState as State diff --git a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/navigation/AppNavigator.kt b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/navigation/AppNavigator.kt index 62e6841c..7490a458 100644 --- a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/navigation/AppNavigator.kt +++ b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/navigation/AppNavigator.kt @@ -1,7 +1,7 @@ package pro.respawn.flowmvi.debugger.server.navigation -import kotlin.uuid.Uuid import pro.respawn.flowmvi.debugger.server.navigation.util.Navigator +import kotlin.uuid.Uuid interface AppNavigator : Navigator { fun connect() diff --git a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/navigation/AppNavigatorImpl.kt b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/navigation/AppNavigatorImpl.kt index 205f5eb3..b21ab9be 100644 --- a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/navigation/AppNavigatorImpl.kt +++ b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/navigation/AppNavigatorImpl.kt @@ -5,11 +5,11 @@ import androidx.compose.runtime.State import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue import androidx.compose.runtime.remember -import kotlin.uuid.Uuid import pro.respawn.flowmvi.debugger.server.navigation.component.RootComponent import pro.respawn.flowmvi.debugger.server.navigation.component.StackComponent import pro.respawn.flowmvi.debugger.server.navigation.destination.Destination import pro.respawn.flowmvi.debugger.server.navigation.details.DetailsComponent +import kotlin.uuid.Uuid @Composable fun rememberAppNavigator( diff --git a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/navigation/destination/Destination.kt b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/navigation/destination/Destination.kt index 2d9ea7bb..27a3b5bf 100644 --- a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/navigation/destination/Destination.kt +++ b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/navigation/destination/Destination.kt @@ -2,9 +2,8 @@ package pro.respawn.flowmvi.debugger.server.navigation.destination import androidx.compose.runtime.Immutable -import kotlin.uuid.Uuid import kotlinx.serialization.Serializable -import kotlinx.serialization.UseSerializers +import kotlin.uuid.Uuid @Serializable @Immutable diff --git a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/ui/screens/storedetails/StoreDetailsContainer.kt b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/ui/screens/storedetails/StoreDetailsContainer.kt index d05e5eee..13b0dc62 100644 --- a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/ui/screens/storedetails/StoreDetailsContainer.kt +++ b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/ui/screens/storedetails/StoreDetailsContainer.kt @@ -1,6 +1,5 @@ package pro.respawn.flowmvi.debugger.server.ui.screens.storedetails -import kotlin.uuid.Uuid import kotlinx.collections.immutable.toPersistentList import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.onEach @@ -27,6 +26,7 @@ import pro.respawn.flowmvi.plugins.recover import pro.respawn.flowmvi.plugins.reduce import pro.respawn.flowmvi.plugins.whileSubscribed import pro.respawn.flowmvi.util.typed +import kotlin.uuid.Uuid private typealias Ctx = PipelineContext diff --git a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/ui/screens/storedetails/StoreDetailsContract.kt b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/ui/screens/storedetails/StoreDetailsContract.kt index 0eb3b7ab..0464d348 100644 --- a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/ui/screens/storedetails/StoreDetailsContract.kt +++ b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/ui/screens/storedetails/StoreDetailsContract.kt @@ -1,7 +1,6 @@ package pro.respawn.flowmvi.debugger.server.ui.screens.storedetails import androidx.compose.runtime.Immutable -import kotlin.uuid.Uuid import kotlinx.collections.immutable.ImmutableList import pro.respawn.flowmvi.api.MVIAction import pro.respawn.flowmvi.api.MVIIntent @@ -9,6 +8,7 @@ import pro.respawn.flowmvi.api.MVIState import pro.respawn.flowmvi.debugger.server.ServerEventEntry import pro.respawn.flowmvi.debugger.server.StoreCommand import pro.respawn.flowmvi.debugger.server.ui.screens.timeline.FocusedEvent +import kotlin.uuid.Uuid @Immutable internal sealed interface StoreDetailsState : MVIState { diff --git a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/ui/screens/storedetails/StoreDetailsScreen.kt b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/ui/screens/storedetails/StoreDetailsScreen.kt index b92718f8..bf1f306a 100644 --- a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/ui/screens/storedetails/StoreDetailsScreen.kt +++ b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/ui/screens/storedetails/StoreDetailsScreen.kt @@ -23,7 +23,6 @@ import androidx.compose.ui.platform.LocalClipboardManager import androidx.compose.ui.text.SpanStyle import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.unit.dp -import kotlin.uuid.Uuid import kotlinx.collections.immutable.toImmutableList import org.koin.core.parameter.parametersOf import pro.respawn.flowmvi.api.IntentReceiver @@ -49,6 +48,7 @@ import pro.respawn.flowmvi.debugger.server.ui.widgets.TypeCrossfade import pro.respawn.flowmvi.util.typed import pro.respawn.kmmutils.common.copies import pro.respawn.kmmutils.compose.annotate +import kotlin.uuid.Uuid @OptIn(ExperimentalMaterial3Api::class) @Composable diff --git a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/ui/screens/timeline/TimelineContract.kt b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/ui/screens/timeline/TimelineContract.kt index 26821893..dc4d9e9c 100644 --- a/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/ui/screens/timeline/TimelineContract.kt +++ b/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server/ui/screens/timeline/TimelineContract.kt @@ -1,7 +1,6 @@ package pro.respawn.flowmvi.debugger.server.ui.screens.timeline import androidx.compose.runtime.Immutable -import kotlin.uuid.Uuid import kotlinx.collections.immutable.ImmutableList import kotlinx.datetime.LocalDateTime import kotlinx.datetime.TimeZone @@ -12,6 +11,7 @@ import pro.respawn.flowmvi.api.MVIState import pro.respawn.flowmvi.debugger.model.ClientEvent import pro.respawn.flowmvi.debugger.server.ServerEventEntry import pro.respawn.flowmvi.debugger.server.util.type +import kotlin.uuid.Uuid internal enum class EventType { Intent, Action, StateChange, Subscription, Connection, Exception, Initialization diff --git a/metrics/src/commonMain/kotlin/pro/respawn/flowmvi/metrics/P2QuantileEstimator.kt b/metrics/src/commonMain/kotlin/pro/respawn/flowmvi/metrics/P2QuantileEstimator.kt index ba3ce577..e8c4d426 100644 --- a/metrics/src/commonMain/kotlin/pro/respawn/flowmvi/metrics/P2QuantileEstimator.kt +++ b/metrics/src/commonMain/kotlin/pro/respawn/flowmvi/metrics/P2QuantileEstimator.kt @@ -120,7 +120,7 @@ internal class P2QuantileEstimator(private vararg val probabilities: Double) : S val qI = q[i] val numerator = (nI - nMinus1 + d) * (qPlus1 - qI) / (nPlus1 - nI) + - (nPlus1 - nI - d) * (qI - qMinus1) / (nI - nMinus1) + (nPlus1 - nI - d) * (qI - qMinus1) / (nI - nMinus1) return qI + d / (nPlus1 - nMinus1) * numerator } diff --git a/sample/src/commonMain/kotlin/pro/respawn/flowmvi/sample/navigation/destination/Destination.kt b/sample/src/commonMain/kotlin/pro/respawn/flowmvi/sample/navigation/destination/Destination.kt index fa8a4ca3..57f33933 100644 --- a/sample/src/commonMain/kotlin/pro/respawn/flowmvi/sample/navigation/destination/Destination.kt +++ b/sample/src/commonMain/kotlin/pro/respawn/flowmvi/sample/navigation/destination/Destination.kt @@ -3,7 +3,6 @@ package pro.respawn.flowmvi.sample.navigation.destination import androidx.compose.runtime.Immutable import kotlinx.serialization.Serializable -import kotlinx.serialization.UseSerializers import pro.respawn.kmmutils.common.fastLazy @Serializable diff --git a/savedstate/src/commonMain/kotlin/pro/respawn/flowmvi/savedstate/plugins/SavedStatePlugin.kt b/savedstate/src/commonMain/kotlin/pro/respawn/flowmvi/savedstate/plugins/SavedStatePlugin.kt index 41412eb2..0fe5afa8 100644 --- a/savedstate/src/commonMain/kotlin/pro/respawn/flowmvi/savedstate/plugins/SavedStatePlugin.kt +++ b/savedstate/src/commonMain/kotlin/pro/respawn/flowmvi/savedstate/plugins/SavedStatePlugin.kt @@ -14,7 +14,6 @@ import pro.respawn.flowmvi.api.MVIState import pro.respawn.flowmvi.api.StorePlugin import pro.respawn.flowmvi.dsl.StoreBuilder import pro.respawn.flowmvi.dsl.lazyPlugin -import pro.respawn.flowmvi.dsl.state import pro.respawn.flowmvi.savedstate.api.SaveBehavior import pro.respawn.flowmvi.savedstate.api.SaveBehavior.OnChange import pro.respawn.flowmvi.savedstate.api.SaveBehavior.OnUnsubscribe diff --git a/settings.gradle.kts b/settings.gradle.kts index f50c45b1..a9d7217d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -19,7 +19,7 @@ dependencyResolutionManagement { // mavenLocal() google() mavenCentral() - maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") + maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") } versionCatalogs { diff --git a/test/src/commonMain/kotlin/pro/respawn/flowmvi/test/plugin/TestPipelineContext.kt b/test/src/commonMain/kotlin/pro/respawn/flowmvi/test/plugin/TestPipelineContext.kt index 945c83a5..10524498 100644 --- a/test/src/commonMain/kotlin/pro/respawn/flowmvi/test/plugin/TestPipelineContext.kt +++ b/test/src/commonMain/kotlin/pro/respawn/flowmvi/test/plugin/TestPipelineContext.kt @@ -2,7 +2,6 @@ package pro.respawn.flowmvi.test.plugin -import kotlinx.atomicfu.atomic import kotlinx.coroutines.Job import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow