From 47357afd16f928260db34d4dd3e686fb9ee7c5ff Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 6 Oct 2022 13:13:10 +0200 Subject: build: Switch to Spotless for formatting This change updates the build configuration to use Spotless for code formating of both Kotlin and Java. --- .../kotlin/org/opendc/compute/api/ServerState.kt | 2 +- .../org/opendc/compute/service/ComputeService.kt | 2 +- .../org/opendc/compute/service/driver/HostState.kt | 2 +- .../service/driver/telemetry/HostSystemStats.kt | 2 +- .../service/scheduler/weights/HostWeigher.kt | 2 +- .../service/scheduler/FilterSchedulerTest.kt | 32 +++++++++++----------- .../org/opendc/compute/simulator/SimHostTest.kt | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) (limited to 'opendc-compute') diff --git a/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ServerState.kt b/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ServerState.kt index a4d7d7d7..2b5aebb1 100644 --- a/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ServerState.kt +++ b/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ServerState.kt @@ -49,5 +49,5 @@ public enum class ServerState { /** * The server has been deleted and cannot be started later on. */ - DELETED, + DELETED } diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/ComputeService.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/ComputeService.kt index 28ef7c40..85222c10 100644 --- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/ComputeService.kt +++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/ComputeService.kt @@ -89,7 +89,7 @@ public interface ComputeService : AutoCloseable { context: CoroutineContext, clock: Clock, scheduler: ComputeScheduler, - schedulingQuantum: Duration = Duration.ofMinutes(5), + schedulingQuantum: Duration = Duration.ofMinutes(5) ): ComputeService { return ComputeServiceImpl(context, clock, scheduler, schedulingQuantum) } diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/HostState.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/HostState.kt index ca6c625c..544b6530 100644 --- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/HostState.kt +++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/HostState.kt @@ -39,5 +39,5 @@ public enum class HostState { /** * The host is in an error state and unable to host any guests. */ - ERROR, + ERROR } diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/telemetry/HostSystemStats.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/telemetry/HostSystemStats.kt index 9d34a5ce..56bd017d 100644 --- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/telemetry/HostSystemStats.kt +++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/telemetry/HostSystemStats.kt @@ -47,5 +47,5 @@ public data class HostSystemStats( val guestsTerminated: Int, val guestsRunning: Int, val guestsError: Int, - val guestsInvalid: Int, + val guestsInvalid: Int ) diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/weights/HostWeigher.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/weights/HostWeigher.kt index aca8c4e6..aa8a9d53 100644 --- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/weights/HostWeigher.kt +++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/weights/HostWeigher.kt @@ -70,6 +70,6 @@ public interface HostWeigher { public val weights: DoubleArray, public val min: Double, public val max: Double, - public val multiplier: Double, + public val multiplier: Double ) } diff --git a/opendc-compute/opendc-compute-service/src/test/kotlin/org/opendc/compute/service/scheduler/FilterSchedulerTest.kt b/opendc-compute/opendc-compute-service/src/test/kotlin/org/opendc/compute/service/scheduler/FilterSchedulerTest.kt index 8ecf7f87..4608bf37 100644 --- a/opendc-compute/opendc-compute-service/src/test/kotlin/org/opendc/compute/service/scheduler/FilterSchedulerTest.kt +++ b/opendc-compute/opendc-compute-service/src/test/kotlin/org/opendc/compute/service/scheduler/FilterSchedulerTest.kt @@ -74,7 +74,7 @@ internal class FilterSchedulerTest { fun testNoHosts() { val scheduler = FilterScheduler( filters = emptyList(), - weighers = emptyList(), + weighers = emptyList() ) val server = mockk() @@ -88,7 +88,7 @@ internal class FilterSchedulerTest { fun testNoFiltersAndSchedulers() { val scheduler = FilterScheduler( filters = emptyList(), - weighers = emptyList(), + weighers = emptyList() ) val hostA = mockk() @@ -144,7 +144,7 @@ internal class FilterSchedulerTest { fun testHostIsDown() { val scheduler = FilterScheduler( filters = listOf(ComputeFilter()), - weighers = emptyList(), + weighers = emptyList() ) val host = mockk() @@ -163,7 +163,7 @@ internal class FilterSchedulerTest { fun testHostIsUp() { val scheduler = FilterScheduler( filters = listOf(ComputeFilter()), - weighers = emptyList(), + weighers = emptyList() ) val host = mockk() @@ -182,7 +182,7 @@ internal class FilterSchedulerTest { fun testRamFilter() { val scheduler = FilterScheduler( filters = listOf(RamFilter(1.0)), - weighers = emptyList(), + weighers = emptyList() ) val hostA = mockk() @@ -209,7 +209,7 @@ internal class FilterSchedulerTest { fun testRamFilterOvercommit() { val scheduler = FilterScheduler( filters = listOf(RamFilter(1.5)), - weighers = emptyList(), + weighers = emptyList() ) val host = mockk() @@ -230,7 +230,7 @@ internal class FilterSchedulerTest { fun testVCpuFilter() { val scheduler = FilterScheduler( filters = listOf(VCpuFilter(1.0)), - weighers = emptyList(), + weighers = emptyList() ) val hostA = mockk() @@ -257,7 +257,7 @@ internal class FilterSchedulerTest { fun testVCpuFilterOvercommit() { val scheduler = FilterScheduler( filters = listOf(VCpuFilter(16.0)), - weighers = emptyList(), + weighers = emptyList() ) val host = mockk() @@ -278,7 +278,7 @@ internal class FilterSchedulerTest { fun testVCpuCapacityFilter() { val scheduler = FilterScheduler( filters = listOf(VCpuCapacityFilter()), - weighers = emptyList(), + weighers = emptyList() ) val hostA = mockk() @@ -306,7 +306,7 @@ internal class FilterSchedulerTest { fun testInstanceCountFilter() { val scheduler = FilterScheduler( filters = listOf(InstanceCountFilter(limit = 2)), - weighers = emptyList(), + weighers = emptyList() ) val hostA = mockk() @@ -333,7 +333,7 @@ internal class FilterSchedulerTest { fun testAffinityFilter() { val scheduler = FilterScheduler( filters = listOf(SameHostFilter()), - weighers = emptyList(), + weighers = emptyList() ) val serverA = mockk() @@ -372,7 +372,7 @@ internal class FilterSchedulerTest { fun testAntiAffinityFilter() { val scheduler = FilterScheduler( filters = listOf(DifferentHostFilter()), - weighers = emptyList(), + weighers = emptyList() ) val serverA = mockk() @@ -411,7 +411,7 @@ internal class FilterSchedulerTest { fun testRamWeigher() { val scheduler = FilterScheduler( filters = emptyList(), - weighers = listOf(RamWeigher(1.5)), + weighers = listOf(RamWeigher(1.5)) ) val hostA = mockk() @@ -438,7 +438,7 @@ internal class FilterSchedulerTest { fun testCoreRamWeigher() { val scheduler = FilterScheduler( filters = emptyList(), - weighers = listOf(CoreRamWeigher(1.5)), + weighers = listOf(CoreRamWeigher(1.5)) ) val hostA = mockk() @@ -465,7 +465,7 @@ internal class FilterSchedulerTest { fun testVCpuWeigher() { val scheduler = FilterScheduler( filters = emptyList(), - weighers = listOf(VCpuWeigher(16.0)), + weighers = listOf(VCpuWeigher(16.0)) ) val hostA = mockk() @@ -492,7 +492,7 @@ internal class FilterSchedulerTest { fun testInstanceCountWeigher() { val scheduler = FilterScheduler( filters = emptyList(), - weighers = listOf(InstanceCountWeigher(multiplier = -1.0)), + weighers = listOf(InstanceCountWeigher(multiplier = -1.0)) ) val hostA = mockk() diff --git a/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt b/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt index 7092d57e..6be1f3c0 100644 --- a/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt +++ b/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt @@ -225,7 +225,7 @@ internal class SimHostTest { { assertEquals(900001, sysStats.uptime.toMillis(), "Uptime does not match") }, { assertEquals(300000, sysStats.downtime.toMillis(), "Downtime does not match") }, { assertEquals(900001, guestSysStats.uptime.toMillis(), "Guest uptime does not match") }, - { assertEquals(300000, guestSysStats.downtime.toMillis(), "Guest downtime does not match") }, + { assertEquals(300000, guestSysStats.downtime.toMillis(), "Guest downtime does not match") } ) } -- cgit v1.2.3