From 0bdf1946ef90c6d7c380eae2b0e3a68e87442119 Mon Sep 17 00:00:00 2001 From: Juul Mobile Bot Date: Fri, 28 Jun 2024 09:08:19 +0000 Subject: [PATCH 1/3] Update plugin kotlinter to v4.4.0 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0e2f361..37c98bd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,5 +8,5 @@ coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", ve [plugins] dokka = { id = "org.jetbrains.dokka", version = "1.9.20" } kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } -kotlinter = { id = "org.jmailen.kotlinter", version = "4.3.0" } +kotlinter = { id = "org.jmailen.kotlinter", version = "4.4.0" } maven-publish = { id = "com.vanniktech.maven.publish", version = "0.29.0" } From 226be646ea4a10d30970a2df1170c1425ec41bb4 Mon Sep 17 00:00:00 2001 From: Travis Wyatt Date: Sat, 6 Jul 2024 23:46:41 -0700 Subject: [PATCH 2/3] Disable undesirable new ktlint rules --- .editorconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/.editorconfig b/.editorconfig index 4a93356..ccd0177 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,6 +5,7 @@ ij_kotlin_allow_trailing_comma_on_call_site = true ktlint_standard_blank-line-before-declaration = disabled ktlint_standard_function-naming = disabled ktlint_standard_function-signature = disabled +ktlint_standard_multiline-loop = disabled ktlint_standard_no-blank-line-in-list = disabled ktlint_standard_no-empty-first-line-in-class-body = disabled From c8dccd27deabee51c1effaf1fd7b4456bc83c498 Mon Sep 17 00:00:00 2001 From: Travis Wyatt Date: Sat, 6 Jul 2024 23:43:22 -0700 Subject: [PATCH 3/3] `./gradlew formatKotlin` --- core/src/jsMain/kotlin/Cursor.kt | 4 +++- core/src/jsMain/kotlin/CursorStart.kt | 13 ++++++++++--- core/src/jsMain/kotlin/Database.kt | 4 +++- core/src/jsMain/kotlin/Exceptions.kt | 14 +++++++++++--- core/src/jsMain/kotlin/Request.kt | 4 +++- 5 files changed, 30 insertions(+), 9 deletions(-) diff --git a/core/src/jsMain/kotlin/Cursor.kt b/core/src/jsMain/kotlin/Cursor.kt index dc3768a..6f2cf54 100644 --- a/core/src/jsMain/kotlin/Cursor.kt +++ b/core/src/jsMain/kotlin/Cursor.kt @@ -34,7 +34,9 @@ public open class Cursor internal constructor( cursor.continuePrimaryKey(key.toJs(), primaryKey.toJs()) } - public enum class Direction(internal val constant: String) { + public enum class Direction( + internal val constant: String, + ) { Next("next"), NextUnique("nextunique"), Previous("prev"), diff --git a/core/src/jsMain/kotlin/CursorStart.kt b/core/src/jsMain/kotlin/CursorStart.kt index 6270b3c..8370720 100644 --- a/core/src/jsMain/kotlin/CursorStart.kt +++ b/core/src/jsMain/kotlin/CursorStart.kt @@ -6,19 +6,26 @@ public sealed class CursorStart { internal abstract fun apply(cursor: IDBCursor) - public data class Advance(val count: Int) : CursorStart() { + public data class Advance( + val count: Int, + ) : CursorStart() { override fun apply(cursor: IDBCursor) { cursor.advance(count) } } - public data class Continue(val key: Key) : CursorStart() { + public data class Continue( + val key: Key, + ) : CursorStart() { override fun apply(cursor: IDBCursor) { cursor.`continue`(key.toJs()) } } - public data class ContinuePrimaryKey(val key: Key, val primaryKey: Key) : CursorStart() { + public data class ContinuePrimaryKey( + val key: Key, + val primaryKey: Key, + ) : CursorStart() { override fun apply(cursor: IDBCursor) { cursor.continuePrimaryKey(key.toJs(), primaryKey.toJs()) } diff --git a/core/src/jsMain/kotlin/Database.kt b/core/src/jsMain/kotlin/Database.kt index 9efd695..9ede687 100644 --- a/core/src/jsMain/kotlin/Database.kt +++ b/core/src/jsMain/kotlin/Database.kt @@ -54,7 +54,9 @@ public suspend fun deleteDatabase(name: String) { } } -public class Database internal constructor(database: IDBDatabase) { +public class Database internal constructor( + database: IDBDatabase, +) { private var database: IDBDatabase? = database init { diff --git a/core/src/jsMain/kotlin/Exceptions.kt b/core/src/jsMain/kotlin/Exceptions.kt index c8fba1f..2699062 100644 --- a/core/src/jsMain/kotlin/Exceptions.kt +++ b/core/src/jsMain/kotlin/Exceptions.kt @@ -8,10 +8,18 @@ public abstract class EventException( public val event: Event, ) : Exception(message, cause) -public class EventHandlerException(cause: Throwable?, event: Event) : EventException("An inner exception was thrown: $cause", cause, event) +public class EventHandlerException( + cause: Throwable?, + event: Event, +) : EventException("An inner exception was thrown: $cause", cause, event) -public class ErrorEventException(event: Event) : EventException("An error event was received.", cause = null, event) -public class OpenBlockedException(public val name: String, event: Event) : EventException("Resource in use: $name.", cause = null, event) +public class ErrorEventException( + event: Event, +) : EventException("An error event was received.", cause = null, event) +public class OpenBlockedException( + public val name: String, + event: Event, +) : EventException("Resource in use: $name.", cause = null, event) public class AbortTransactionException( event: Event, ) : EventException("Transaction aborted while waiting for completion.", cause = null, event) diff --git a/core/src/jsMain/kotlin/Request.kt b/core/src/jsMain/kotlin/Request.kt index d620471..c330ab0 100644 --- a/core/src/jsMain/kotlin/Request.kt +++ b/core/src/jsMain/kotlin/Request.kt @@ -2,4 +2,6 @@ package com.juul.indexeddb import com.juul.indexeddb.external.IDBRequest -public class Request internal constructor(internal val request: IDBRequest) +public class Request internal constructor( + internal val request: IDBRequest, +)