Skip to content

Commit

Permalink
Fixed all warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
arkivanov committed Nov 3, 2023
1 parent 7f9c24c commit 4f5270c
Show file tree
Hide file tree
Showing 25 changed files with 79 additions and 52 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ setupDefaults(
js { browser() }
linuxX64()
iosCompat()
watchosCompat()
tvosCompat()
macosCompat()
// watchosCompat()
// tvosCompat()
// macosCompat()
},
androidConfig = AndroidConfig(
minSdkVersion = 15,
Expand Down
2 changes: 1 addition & 1 deletion deps.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ kotlin = "1.9.20"
kotlinxBinaryCompatibilityValidator = "0.13.2"
kotlinxCoroutines = "1.7.3"
intellijGradlePlugin = "1.15.0"
detektGradlePlugin = "1.22.0"
detektGradlePlugin = "1.23.3"
essenty = "1.2.0"
reaktive = "1.3.0"
multiplatformSettings = "0.8.1"
Expand Down
2 changes: 1 addition & 1 deletion detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ performance:

style:
ForbiddenComment:
values: ['FIXME:', 'STOPSHIP:']
comments: ['FIXME:', 'STOPSHIP:']
MagicNumber:
active: false
MaxLineLength:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.arkivanov.mvikotlin.core.store.Store
import com.arkivanov.mvikotlin.core.utils.assertOnMainThread
import com.arkivanov.mvikotlin.core.view.ViewRenderer
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.Job
Expand Down Expand Up @@ -96,6 +97,7 @@ private class BuilderBinder(
this bindTo { store.accept(it) }
}

@OptIn(DelicateCoroutinesApi::class)
override fun start() {
job =
GlobalScope.launch(mainContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import com.badoo.reaktive.observable.subscribe
import com.badoo.reaktive.subject.behavior.BehaviorObservable
import org.jetbrains.compose.web.attributes.AttrsBuilder
import org.jetbrains.compose.web.attributes.AttrsScope
import org.jetbrains.compose.web.attributes.AttrsScopeBuilder
import org.jetbrains.compose.web.dom.AttrBuilderContext
import org.w3c.dom.Element

Expand All @@ -28,7 +28,7 @@ internal fun <T> BehaviorObservable<T>.subscribeAsState(): State<T> {
return state
}

internal fun <T : Element> AttrsBuilder<T>.add(attrs: AttrBuilderContext<T>?) {
internal fun <T : Element> AttrsScopeBuilder<T>.add(attrs: AttrBuilderContext<T>?) {
attrs?.invoke(this)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ internal class ConnectionThread(

memScoped {
val sin = alloc<sockaddr_in>()
memset(sin.ptr, 0, sockaddr_in.size.convert())
memset(sin.ptr, 0, sizeOf<sockaddr_in>().convert())
sin.sin_len = sizeOf<sockaddr_in>().convert()
sin.sin_family = AF_INET.convert()
sin.sin_port = getSinPort()
sin.sin_addr.s_addr = INADDR_ANY

if (bind(serverSocket, sin.ptr.reinterpret(), sockaddr_in.size.convert()) < 0) {
if (bind(serverSocket, sin.ptr.reinterpret(), sizeOf<sockaddr_in>().convert()) < 0) {
onError(Exception("Error bind socket: $errno"))
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface BehaviorSubject<T> : Subject<T> {
val value: T
}

@Suppress("FunctionName")
@Suppress("FunctionNaming") // https://github.com/detekt/detekt/issues/6601
fun <T> BehaviorSubject(initialValue: T): BehaviorSubject<T> = BehaviorSubjectImpl(initialValue)

private class BehaviorSubjectImpl<T>(initialValue: T) : BaseSubject<T>(), BehaviorSubject<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.arkivanov.mvikotlin.rx.internal

interface PublishSubject<T> : Subject<T>

@Suppress("FunctionName")
@Suppress("FunctionNaming") // https://github.com/detekt/detekt/issues/6601
fun <T> PublishSubject(): PublishSubject<T> = PublishSubjectImpl()

private class PublishSubjectImpl<T> : BaseSubject<T>(), PublishSubject<T>
48 changes: 30 additions & 18 deletions sample/coroutines/app-js/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
import com.arkivanov.gradle.setupJsApp
import com.arkivanov.gradle.bundle
import com.arkivanov.gradle.setupMultiplatform
import com.arkivanov.gradle.setupSourceSets

plugins {
id("org.jetbrains.kotlin.js")
id("kotlin-multiplatform")
id("com.arkivanov.gradle.setup")
}

setupJsApp()
setupMultiplatform {
js {
browser()
binaries.executable()
}
}

kotlin {
setupSourceSets {
val js by bundle()

dependencies {
implementation(kotlin("stdlib-js"))
implementation(project(":rx"))
implementation(project(":mvikotlin-main"))
implementation(project(":mvikotlin-logging"))
implementation(project(":mvikotlin-timetravel"))
implementation(project(":sample:coroutines:shared"))
js.main.dependencies {
implementation(project(":rx"))
implementation(project(":mvikotlin-main"))
implementation(project(":mvikotlin-logging"))
implementation(project(":mvikotlin-timetravel"))
implementation(project(":sample:coroutines:shared"))

implementation(enforcedPlatform(deps.kotlinWrappers.kotlinWrappersBom))
implementation("org.jetbrains.kotlin-wrappers:kotlin-react")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-router-dom")
implementation("org.jetbrains.kotlin-wrappers:kotlin-styled")
implementation("org.jetbrains.kotlin-wrappers:kotlin-extensions")
implementation("org.jetbrains.kotlin-wrappers:kotlin-emotion")
implementation("org.jetbrains.kotlin-wrappers:kotlin-mui")
implementation(project.dependencies.platform(deps.kotlinWrappers.kotlinWrappersBom))
implementation("org.jetbrains.kotlin-wrappers:kotlin-react")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-router-dom")
implementation("org.jetbrains.kotlin-wrappers:kotlin-styled")
implementation("org.jetbrains.kotlin-wrappers:kotlin-extensions")
implementation("org.jetbrains.kotlin-wrappers:kotlin-emotion")
implementation("org.jetbrains.kotlin-wrappers:kotlin-mui")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.arkivanov.mvikotlin.sample.coroutines.shared.DefaultDispatchers
import com.arkivanov.mvikotlin.sample.coroutines.shared.TodoDispatchers
import com.arkivanov.mvikotlin.sample.database.DefaultTodoDatabase
import com.arkivanov.mvikotlin.sample.database.TodoDatabase
import com.arkivanov.mvikotlin.timetravel.ExperimentalTimeTravelApi
import com.arkivanov.mvikotlin.timetravel.TimeTravelServer
import kotlinx.coroutines.flow.MutableSharedFlow
import mui.material.Box
Expand All @@ -28,6 +29,7 @@ import web.cssom.vh
import web.cssom.vw
import web.dom.document

@OptIn(ExperimentalTimeTravelApi::class)
fun main() {
TimeTravelServer().start()

Expand Down
48 changes: 30 additions & 18 deletions sample/reaktive/app-js/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
import com.arkivanov.gradle.setupJsApp
import com.arkivanov.gradle.bundle
import com.arkivanov.gradle.setupMultiplatform
import com.arkivanov.gradle.setupSourceSets

plugins {
id("org.jetbrains.kotlin.js")
id("kotlin-multiplatform")
id("com.arkivanov.gradle.setup")
}

setupJsApp()
setupMultiplatform {
js {
browser()
binaries.executable()
}
}

kotlin {
setupSourceSets {
val js by bundle()

dependencies {
implementation(kotlin("stdlib-js"))
implementation(project(":rx"))
implementation(project(":mvikotlin-main"))
implementation(project(":mvikotlin-logging"))
implementation(project(":mvikotlin-timetravel"))
implementation(project(":sample:reaktive:shared"))
js.main.dependencies {
implementation(project(":rx"))
implementation(project(":mvikotlin-main"))
implementation(project(":mvikotlin-logging"))
implementation(project(":mvikotlin-timetravel"))
implementation(project(":sample:reaktive:shared"))

implementation(enforcedPlatform(deps.kotlinWrappers.kotlinWrappersBom))
implementation("org.jetbrains.kotlin-wrappers:kotlin-react")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-router-dom")
implementation("org.jetbrains.kotlin-wrappers:kotlin-styled")
implementation("org.jetbrains.kotlin-wrappers:kotlin-extensions")
implementation("org.jetbrains.kotlin-wrappers:kotlin-emotion")
implementation("org.jetbrains.kotlin-wrappers:kotlin-mui")
implementation(project.dependencies.platform(deps.kotlinWrappers.kotlinWrappersBom))
implementation("org.jetbrains.kotlin-wrappers:kotlin-react")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-router-dom")
implementation("org.jetbrains.kotlin-wrappers:kotlin-styled")
implementation("org.jetbrains.kotlin-wrappers:kotlin-extensions")
implementation("org.jetbrains.kotlin-wrappers:kotlin-emotion")
implementation("org.jetbrains.kotlin-wrappers:kotlin-mui")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package com.arkivanov.mvikotlin.sample.reaktive.app

import com.arkivanov.mvikotlin.core.store.StoreFactory
import com.arkivanov.mvikotlin.logging.store.LoggingStoreFactory
import com.arkivanov.mvikotlin.main.store.DefaultStoreFactory
import com.arkivanov.mvikotlin.sample.database.DefaultTodoDatabase
import com.arkivanov.mvikotlin.sample.database.TodoDatabase
import com.arkivanov.mvikotlin.timetravel.ExperimentalTimeTravelApi
import com.arkivanov.mvikotlin.timetravel.TimeTravelServer
import com.arkivanov.mvikotlin.timetravel.store.TimeTravelStoreFactory
import com.badoo.reaktive.subject.publish.PublishSubject
Expand All @@ -28,6 +28,7 @@ import web.cssom.vh
import web.cssom.vw
import web.dom.document

@OptIn(ExperimentalTimeTravelApi::class)
fun main() {
TimeTravelServer().start()

Expand Down
2 changes: 1 addition & 1 deletion sample/reaktive/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {
}

setupMultiplatform {
android()
androidTarget()
js { browser() }
iosCompat(
arm64 = null, // Comment out to enable arm64 target
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.toString() == "com.arkivanov.gradle.setup") {
useModule("com.github.arkivanov:gradle-setup-plugin:2571f348ff")
useModule("com.github.arkivanov:gradle-setup-plugin:655aedff78")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,5 @@ actual fun atomic(value: Int): AtomicInt =

override fun toByte(): Byte = value.toByte()

override fun toChar(): Char = value.toChar()

override fun toShort(): Short = value.toShort()
}

0 comments on commit 4f5270c

Please sign in to comment.