From 48b1675af7c5b488d7210181979e53324946dd5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=E2=80=9CCLOVIS=E2=80=9D=20Canet?= Date: Fri, 16 May 2025 21:10:37 +0200 Subject: [PATCH 1/2] style(weak): Act on static analysis warnings --- weak/src/commonMain/kotlin/algorithms/WeakKeyArrayMap.kt | 4 ++++ weak/src/jsMain/kotlin/WeakMap.js.kt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/weak/src/commonMain/kotlin/algorithms/WeakKeyArrayMap.kt b/weak/src/commonMain/kotlin/algorithms/WeakKeyArrayMap.kt index c8112a7..41347b9 100644 --- a/weak/src/commonMain/kotlin/algorithms/WeakKeyArrayMap.kt +++ b/weak/src/commonMain/kotlin/algorithms/WeakKeyArrayMap.kt @@ -125,6 +125,7 @@ private val compareByIdentity = { a: Any?, b: Any? -> a === b } * * Additionally, older elements are visited more often, so they are more likely to be freed early. */ +@Suppress("FunctionName") @ExperimentalWeakApi fun WeakKeyArrayMap(): WeakMap = WeakKeyMapImpl( @@ -151,6 +152,7 @@ fun WeakKeyArrayMap(): WeakMap = * * Additionally, older elements are visited more often, so they are more likely to be freed early. */ +@Suppress("FunctionName") @ExperimentalWeakApi fun SoftKeyArrayMap(): WeakMap = WeakKeyMapImpl( @@ -175,6 +177,7 @@ fun SoftKeyArrayMap(): WeakMap = * * Additionally, older elements are visited more often, so they are more likely to be freed early. */ +@Suppress("FunctionName") @ExperimentalWeakApi fun IdentityWeakKeyArrayMap(): WeakMap = WeakKeyMapImpl( @@ -203,6 +206,7 @@ fun IdentityWeakKeyArrayMap(): WeakMap = * * Additionally, older elements are visited more often, so they are more likely to be freed early. */ +@Suppress("FunctionName") @ExperimentalWeakApi fun IdentitySoftKeyArrayMap(): WeakMap = WeakKeyMapImpl( diff --git a/weak/src/jsMain/kotlin/WeakMap.js.kt b/weak/src/jsMain/kotlin/WeakMap.js.kt index a48a97a..e08ae6e 100644 --- a/weak/src/jsMain/kotlin/WeakMap.js.kt +++ b/weak/src/jsMain/kotlin/WeakMap.js.kt @@ -64,7 +64,7 @@ private class JsWeakMap( */ @ExperimentalWeakApi actual fun WeakMap(): WeakMap = - JsWeakMap(js.collections.WeakMap()) + JsWeakMap(js.collections.WeakMap()) /** * Instantiates a new [WeakMap] by copying [values]. -- 2.51.2 From 568ef979703f4d4af84fc0f4516b84bc276f9633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=E2=80=9CCLOVIS=E2=80=9D=20Canet?= Date: Fri, 16 May 2025 21:12:24 +0200 Subject: [PATCH 2/2] style(logger): Act on static analysis warnings --- logger/src/commonMain/kotlin/LogLevel.kt | 1 + logger/src/commonMain/kotlin/Logger.kt | 3 ++- logger/src/commonTest/kotlin/LoggerTest.kt | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/logger/src/commonMain/kotlin/LogLevel.kt b/logger/src/commonMain/kotlin/LogLevel.kt index 3e166c3..e18fa63 100644 --- a/logger/src/commonMain/kotlin/LogLevel.kt +++ b/logger/src/commonMain/kotlin/LogLevel.kt @@ -24,6 +24,7 @@ enum class LogLevel { INFO, WARN, ERROR, + @Suppress("unused") NONE, ; diff --git a/logger/src/commonMain/kotlin/Logger.kt b/logger/src/commonMain/kotlin/Logger.kt index 7d0151f..ebc5801 100644 --- a/logger/src/commonMain/kotlin/Logger.kt +++ b/logger/src/commonMain/kotlin/Logger.kt @@ -128,7 +128,8 @@ interface Logger { fun loggerFor(obj: Any): Logger = VerySimpleLogger(obj) -private class VerySimpleLogger(private val obj: Any) : Logger { +private class VerySimpleLogger(obj: Any) : Logger { + @Deprecated(DEPRECATION_MESSAGE) override var level: LogLevel = LogLevel.default private val objName = obj::class.toString() diff --git a/logger/src/commonTest/kotlin/LoggerTest.kt b/logger/src/commonTest/kotlin/LoggerTest.kt index 2a89788..905ddd7 100644 --- a/logger/src/commonTest/kotlin/LoggerTest.kt +++ b/logger/src/commonTest/kotlin/LoggerTest.kt @@ -23,6 +23,7 @@ import opensavvy.logger.Logger.Companion.trace import opensavvy.logger.Logger.Companion.warn import opensavvy.prepared.runner.kotest.PreparedSpec +@Suppress("DEPRECATION") class LoggerTest : PreparedSpec({ test("Output") { -- 2.51.2