Skip to content

Commit b338fae

Browse files
committed
Fix other lint and formatting errors
1 parent f03aeb4 commit b338fae

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

core/src/commonIntegrationTest/kotlin/com/powersync/sync/SyncProgressTest.kt

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import com.powersync.testutils.ActiveDatabaseTest
1111
import com.powersync.testutils.databaseTest
1212
import com.powersync.testutils.waitFor
1313
import kotlinx.coroutines.channels.Channel
14-
import kotlinx.coroutines.test.runTest
1514
import kotlin.test.BeforeTest
1615
import kotlin.test.Test
1716
import kotlin.test.assertEquals

core/src/commonMain/kotlin/com/powersync/db/internal/PowerSyncVersion.kt

+17-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
package com.powersync.db.internal
22

3-
internal data class PowerSyncVersion(val major: Int, val minor: Int, val patch: Int): Comparable<PowerSyncVersion> {
4-
override fun compareTo(other: PowerSyncVersion): Int {
5-
return when (val compareMajor = major.compareTo(other.major)) {
6-
0 -> when (val compareMinor = minor.compareTo(other.minor)) {
7-
0 -> patch.compareTo(other.patch)
8-
else -> compareMinor
9-
}
3+
internal data class PowerSyncVersion(
4+
val major: Int,
5+
val minor: Int,
6+
val patch: Int,
7+
) : Comparable<PowerSyncVersion> {
8+
override fun compareTo(other: PowerSyncVersion): Int =
9+
when (val compareMajor = major.compareTo(other.major)) {
10+
0 ->
11+
when (val compareMinor = minor.compareTo(other.minor)) {
12+
0 -> patch.compareTo(other.patch)
13+
else -> compareMinor
14+
}
1015
else -> compareMajor
1116
}
12-
}
1317

14-
override fun toString(): String {
15-
return "$major.$minor.$patch"
16-
}
18+
override fun toString(): String = "$major.$minor.$patch"
1719

1820
companion object {
1921
val MINIMUM: PowerSyncVersion = PowerSyncVersion(0, 3, 14)
@@ -32,7 +34,10 @@ internal data class PowerSyncVersion(val major: Int, val minor: Int, val patch:
3234
return PowerSyncVersion(versionInts[0], versionInts[1], versionInts[2])
3335
}
3436

35-
fun mismatchError(actualVersion: String, details: String? = null): Nothing {
37+
fun mismatchError(
38+
actualVersion: String,
39+
details: String? = null,
40+
): Nothing {
3641
var message = "Unsupported PowerSync extension version (need ^$MINIMUM, got $actualVersion)."
3742
if (details != null) {
3843
message = " Details: $details"

core/src/commonMain/kotlin/com/powersync/sync/Progress.kt

+3-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public interface ProgressWithOperations {
2121

2222
/**
2323
* How many operations, out of [totalOperations], have already been downloaded.
24-
*/
24+
*/
2525
public val downloadedOperations: Int
2626

2727
/**
@@ -43,7 +43,7 @@ public interface ProgressWithOperations {
4343
internal data class ProgressInfo(
4444
override val downloadedOperations: Int,
4545
override val totalOperations: Int,
46-
): ProgressWithOperations
46+
) : ProgressWithOperations
4747

4848
/**
4949
* Provides realtime progress on how PowerSync is downloading rows.
@@ -67,8 +67,7 @@ internal data class ProgressInfo(
6767
@ConsistentCopyVisibility
6868
public data class SyncDownloadProgress private constructor(
6969
private val buckets: Map<String, BucketProgress>,
70-
): ProgressWithOperations {
71-
70+
) : ProgressWithOperations {
7271
override val downloadedOperations: Int
7372
override val totalOperations: Int
7473

0 commit comments

Comments
 (0)