From 180a69d7562715cc17be10cd64748a93d31dbca8 Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Wed, 10 Apr 2024 16:49:57 +0800 Subject: [PATCH] fix some detekt warning --- .../jsMain/kotlin/love/forte/simbot/common/time/TimeUnit.js.kt | 3 ++- .../love/forte/simbot/common/services/Services.native.kt | 1 + .../kotlin/love/forte/simbot/common/time/TimeUnit.native.kt | 3 ++- .../kotlin/love/forte/simbot/common/time/TimeUnit.wasmjs.kt | 3 ++- .../continuous/session/AbstractContinuousSessionContext.kt | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/simbot-commons/simbot-common-core/src/jsMain/kotlin/love/forte/simbot/common/time/TimeUnit.js.kt b/simbot-commons/simbot-common-core/src/jsMain/kotlin/love/forte/simbot/common/time/TimeUnit.js.kt index 7ebf3fb92..5764e446c 100644 --- a/simbot-commons/simbot-common-core/src/jsMain/kotlin/love/forte/simbot/common/time/TimeUnit.js.kt +++ b/simbot-commons/simbot-common-core/src/jsMain/kotlin/love/forte/simbot/common/time/TimeUnit.js.kt @@ -4,7 +4,7 @@ * Project https://github.com/simple-robot/simpler-robot * Email ForteScarlet@163.com * - * This file is part of the Simple Robot Library. + * This file is part of the Simple Robot Library (Alias: simple-robot, simbot, etc.). * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -173,6 +173,7 @@ public actual enum class TimeUnit(private val scale: Long) { * @param dst result unit scale * @param src source unit scale */ +@Suppress("UnnecessaryParentheses") private fun cvt(d: Long, dst: Long, src: Long): Long { var r: Long return when { diff --git a/simbot-commons/simbot-common-core/src/nativeMain/kotlin/love/forte/simbot/common/services/Services.native.kt b/simbot-commons/simbot-common-core/src/nativeMain/kotlin/love/forte/simbot/common/services/Services.native.kt index f85b153a9..0f9fe1fda 100644 --- a/simbot-commons/simbot-common-core/src/nativeMain/kotlin/love/forte/simbot/common/services/Services.native.kt +++ b/simbot-commons/simbot-common-core/src/nativeMain/kotlin/love/forte/simbot/common/services/Services.native.kt @@ -67,4 +67,5 @@ internal actual fun loadProvidersInternal(type: KClass): Sequence<( } @PublishedApi +@Suppress("TopLevelPropertyNaming") internal actual const val isJvm: Boolean = false diff --git a/simbot-commons/simbot-common-core/src/nativeMain/kotlin/love/forte/simbot/common/time/TimeUnit.native.kt b/simbot-commons/simbot-common-core/src/nativeMain/kotlin/love/forte/simbot/common/time/TimeUnit.native.kt index d83dda8c7..51eca28a5 100644 --- a/simbot-commons/simbot-common-core/src/nativeMain/kotlin/love/forte/simbot/common/time/TimeUnit.native.kt +++ b/simbot-commons/simbot-common-core/src/nativeMain/kotlin/love/forte/simbot/common/time/TimeUnit.native.kt @@ -4,7 +4,7 @@ * Project https://github.com/simple-robot/simpler-robot * Email ForteScarlet@163.com * - * This file is part of the Simple Robot Library. + * This file is part of the Simple Robot Library (Alias: simple-robot, simbot, etc.). * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -168,6 +168,7 @@ public actual enum class TimeUnit(private val scale: Long) { * @param dst result unit scale * @param src source unit scale */ +@Suppress("UnnecessaryParentheses") private fun cvt(d: Long, dst: Long, src: Long): Long { var r: Long return when { diff --git a/simbot-commons/simbot-common-core/src/wasmJsMain/kotlin/love/forte/simbot/common/time/TimeUnit.wasmjs.kt b/simbot-commons/simbot-common-core/src/wasmJsMain/kotlin/love/forte/simbot/common/time/TimeUnit.wasmjs.kt index 7ebf3fb92..5764e446c 100644 --- a/simbot-commons/simbot-common-core/src/wasmJsMain/kotlin/love/forte/simbot/common/time/TimeUnit.wasmjs.kt +++ b/simbot-commons/simbot-common-core/src/wasmJsMain/kotlin/love/forte/simbot/common/time/TimeUnit.wasmjs.kt @@ -4,7 +4,7 @@ * Project https://github.com/simple-robot/simpler-robot * Email ForteScarlet@163.com * - * This file is part of the Simple Robot Library. + * This file is part of the Simple Robot Library (Alias: simple-robot, simbot, etc.). * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -173,6 +173,7 @@ public actual enum class TimeUnit(private val scale: Long) { * @param dst result unit scale * @param src source unit scale */ +@Suppress("UnnecessaryParentheses") private fun cvt(d: Long, dst: Long, src: Long): Long { var r: Long return when { diff --git a/simbot-extensions/simbot-extension-continuous-session/src/commonMain/kotlin/love/forte/simbot/extension/continuous/session/AbstractContinuousSessionContext.kt b/simbot-extensions/simbot-extension-continuous-session/src/commonMain/kotlin/love/forte/simbot/extension/continuous/session/AbstractContinuousSessionContext.kt index 35f2a4b5d..c6a773667 100644 --- a/simbot-extensions/simbot-extension-continuous-session/src/commonMain/kotlin/love/forte/simbot/extension/continuous/session/AbstractContinuousSessionContext.kt +++ b/simbot-extensions/simbot-extension-continuous-session/src/commonMain/kotlin/love/forte/simbot/extension/continuous/session/AbstractContinuousSessionContext.kt @@ -96,6 +96,7 @@ public abstract class AbstractContinuousSessionContext(coroutineContext: C * 创建一个 [ContinuousSessionContext] 的基础实现类型。 */ @JvmName("createContinuousSessionContext") +@Suppress("FunctionNaming") public fun ContinuousSessionContext(coroutineContext: CoroutineContext): ContinuousSessionContext = SimpleContinuousSessionContext(coroutineContext)