diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4db5dad1..8eff825e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -27,7 +27,7 @@ gradle-detekt = { group = "io.gitlab.arturbosch.detekt", name = "detekt-gradle-p gradle-bmVersions = { group = "com.github.ben-manes", name = "gradle-versions-plugin", version = "0.51.0" } gradle-gitVersioning = { group = "me.qoomon", name = "gradle-git-versioning-plugin", version = "6.3.0" } gradle-taskTree = { group = "com.dorongold.plugins", name = "task-tree", version = "4.0.0" } -gradle-spotless = { group = "com.diffplug.spotless", name = "spotless-plugin-gradle", version = "6.25.0" } +gradle-spotless = { group = "com.diffplug.spotless", name = "spotless-plugin-gradle", version = "7.0.0.BETA4" } gradle-nexusPublish = { group = "io.github.gradle-nexus", name = "publish-plugin", version = "1.1.0" } # gradle-kover = { group = "org.jetbrains.kotlinx", name = "kover", version = "0.6.1" } diff --git a/stars-core/src/main/kotlin/tools/aqua/stars/core/evaluation/PredicateContext.kt b/stars-core/src/main/kotlin/tools/aqua/stars/core/evaluation/PredicateContext.kt index d584f692..dd0cfc58 100644 --- a/stars-core/src/main/kotlin/tools/aqua/stars/core/evaluation/PredicateContext.kt +++ b/stars-core/src/main/kotlin/tools/aqua/stars/core/evaluation/PredicateContext.kt @@ -65,6 +65,7 @@ class PredicateContext< private val binaryPredicateCache: MutableMap, Triple>, Boolean> = mutableMapOf() + // TODO: Check if the caches are still "useful" and actually used. /** diff --git a/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/metrics/evaluation/ValidTSCInstancesPerTSCMetric.kt b/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/metrics/evaluation/ValidTSCInstancesPerTSCMetric.kt index 1c133004..fba40330 100644 --- a/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/metrics/evaluation/ValidTSCInstancesPerTSCMetric.kt +++ b/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/metrics/evaluation/ValidTSCInstancesPerTSCMetric.kt @@ -394,6 +394,7 @@ class ValidTSCInstancesPerTSCMetric< yAxisScaleMaxValue = 100, fileName = "${plotFileNameCombinedPercentage}_scaled") } + // endregion // region CSV files diff --git a/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/metrics/postEvaluation/FailedMonitorsGroupedByTSCNodeMetric.kt b/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/metrics/postEvaluation/FailedMonitorsGroupedByTSCNodeMetric.kt index fb4ecdcf..c72ddf04 100644 --- a/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/metrics/postEvaluation/FailedMonitorsGroupedByTSCNodeMetric.kt +++ b/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/metrics/postEvaluation/FailedMonitorsGroupedByTSCNodeMetric.kt @@ -42,12 +42,12 @@ import tools.aqua.stars.core.types.* * @param S [SegmentType]. * @param U [TickUnit]. * @param D [TickDifference]. - * @param onlyLeafNodes (Default: false) Whether the monitor should only be triggered for leaf - * nodes. * @property dependsOn The instance of a [ValidTSCInstancesPerTSCMetric] on which this metric * depends on and needs for its calculation. * @property loggerIdentifier identifier (name) for the logger. * @property logger [Logger] instance. + * @param onlyLeafNodes (Default: false) Whether the monitor should only be triggered for leaf + * nodes. */ @Suppress("unused") class FailedMonitorsGroupedByTSCNodeMetric< diff --git a/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/metrics/postEvaluation/FailedMonitorsMetric.kt b/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/metrics/postEvaluation/FailedMonitorsMetric.kt index c0d7e321..edc1b480 100644 --- a/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/metrics/postEvaluation/FailedMonitorsMetric.kt +++ b/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/metrics/postEvaluation/FailedMonitorsMetric.kt @@ -67,6 +67,7 @@ class FailedMonitorsMetric< val failedMonitors: MutableMap, List>> = mutableMapOf() + /** * Calculates a [Map] of [TSCFailedMonitorInstance]s for all [TSC]s by validating all monitors for * all valid [TSCInstance]s. diff --git a/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/utils/ApplicationConstantsHolder.kt b/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/utils/ApplicationConstantsHolder.kt index 5ed45d9a..68dd150c 100644 --- a/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/utils/ApplicationConstantsHolder.kt +++ b/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/utils/ApplicationConstantsHolder.kt @@ -124,7 +124,7 @@ object ApplicationConstantsHolder { /** * Writes the experiment run metadata into the file [METADATA_FILE_NAME] in the serialization - * folders + * folders. */ fun writeMetaInfo(directory: String): File = File("$directory$METADATA_FILE_NAME.txt").apply { diff --git a/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/utils/JsonDataReader.kt b/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/utils/JsonDataReader.kt index d017e1b3..357d254d 100644 --- a/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/utils/JsonDataReader.kt +++ b/stars-core/src/main/kotlin/tools/aqua/stars/core/metric/utils/JsonDataReader.kt @@ -46,6 +46,7 @@ val baseline: Map> */ fun getBaselineSerializationResultDirectory(): File? = File(serializedResultsFolder).listFiles()?.firstOrNull { it.name == baselineDirectory } + // endregion // region previous Results diff --git a/stars-core/src/main/kotlin/tools/aqua/stars/core/tsc/node/TSCNode.kt b/stars-core/src/main/kotlin/tools/aqua/stars/core/tsc/node/TSCNode.kt index 3379c6e4..d22ae9ec 100644 --- a/stars-core/src/main/kotlin/tools/aqua/stars/core/tsc/node/TSCNode.kt +++ b/stars-core/src/main/kotlin/tools/aqua/stars/core/tsc/node/TSCNode.kt @@ -33,10 +33,10 @@ import tools.aqua.stars.core.types.* * @param S [SegmentType]. * @param U [TickUnit]. * @param D [TickDifference]. - * @param monitorsMap Map of monitor labels to their predicates of the [TSCNode]. - * @param projectionsMap Map of projections of the [TSCNode]. * @property label Label of the [TSCNode]. * @property edges Outgoing [TSCEdge]s of the [TSCNode]. + * @param monitorsMap Map of monitor labels to their predicates of the [TSCNode]. + * @param projectionsMap Map of projections of the [TSCNode]. * @property valueFunction Value function predicate of the [TSCNode]. */ sealed class TSCNode< diff --git a/stars-core/src/test/kotlin/tools/aqua/stars/core/metric/util/SerializationHelpersTest.kt b/stars-core/src/test/kotlin/tools/aqua/stars/core/metric/util/SerializationHelpersTest.kt index 9984c37a..ccc51209 100644 --- a/stars-core/src/test/kotlin/tools/aqua/stars/core/metric/util/SerializationHelpersTest.kt +++ b/stars-core/src/test/kotlin/tools/aqua/stars/core/metric/util/SerializationHelpersTest.kt @@ -79,6 +79,7 @@ class SerializationHelpersTest { assertEquals(actualFileContent, actualFile.readText()) assertEquals(actualFile, resultPath) } + // endregion // region Tests for saveAsJsonFile(SerializableResult) @@ -108,6 +109,7 @@ class SerializationHelpersTest { // Check that the content of the file is actually the Json string of the SerializableResult assertEquals(actualSerializableResult.getJsonString(), resultPath.readText()) } + // endregion // region Tests for saveAsJsonFile(SerializableResultComparison,Boolean) @@ -180,6 +182,7 @@ class SerializationHelpersTest { // Check that the content of the file is actually the Json string of the SerializableResult assertEquals(actualSerializableResultComparison.getJsonString(), resultPath.readText()) } + // endregion // region Tests for getLatestSerializationResultPath() @@ -264,6 +267,7 @@ class SerializationHelpersTest { assertNull(latestResult) } + // endregion // region Tests for getBaselineSerializationResultPath() diff --git a/stars-core/src/test/kotlin/tools/aqua/stars/core/tsc/TSCDuplicatedLabelsTest.kt b/stars-core/src/test/kotlin/tools/aqua/stars/core/tsc/TSCDuplicatedLabelsTest.kt index a6edfb86..05bd975d 100644 --- a/stars-core/src/test/kotlin/tools/aqua/stars/core/tsc/TSCDuplicatedLabelsTest.kt +++ b/stars-core/src/test/kotlin/tools/aqua/stars/core/tsc/TSCDuplicatedLabelsTest.kt @@ -57,6 +57,7 @@ class TSCDuplicatedLabelsTest { } } } + // endregion // region projection labels /** Test duplicated projection labels on same level throwing exception. */ @@ -98,6 +99,7 @@ class TSCDuplicatedLabelsTest { } } } + // endregion // region monitor labels /** Test duplicated monitor labels on same level throwing exception. */ diff --git a/stars-core/src/test/kotlin/tools/aqua/stars/core/tsc/TSCRootTest.kt b/stars-core/src/test/kotlin/tools/aqua/stars/core/tsc/TSCRootTest.kt index 8b2d84db..6f86666d 100644 --- a/stars-core/src/test/kotlin/tools/aqua/stars/core/tsc/TSCRootTest.kt +++ b/stars-core/src/test/kotlin/tools/aqua/stars/core/tsc/TSCRootTest.kt @@ -88,6 +88,7 @@ class TSCRootTest { SimpleTickDataDifference> {} } } + // endregion // region Test adding simple true conditions to root note @@ -180,6 +181,7 @@ class TSCRootTest { } } } + // endregion // region Test adding simple false conditions to root note @@ -272,6 +274,7 @@ class TSCRootTest { } } } + // endregion // region Test adding complex true conditions to root note @@ -364,6 +367,7 @@ class TSCRootTest { } } } + // endregion // region Test adding complex false conditions to root note diff --git a/stars-core/src/test/kotlin/tools/aqua/stars/core/tsc/TSCToStringTest.kt b/stars-core/src/test/kotlin/tools/aqua/stars/core/tsc/TSCToStringTest.kt index 3219694d..983d7ce8 100644 --- a/stars-core/src/test/kotlin/tools/aqua/stars/core/tsc/TSCToStringTest.kt +++ b/stars-core/src/test/kotlin/tools/aqua/stars/core/tsc/TSCToStringTest.kt @@ -243,6 +243,7 @@ class TSCToStringTest { } assertEquals("optional(0..3)\n-T-> leaf_1\n-T-> leaf_2\n-T-> leaf_3", tsc.toString()) } + // endregion // region TSC with multiple layers of hierarchy diff --git a/stars-importer-carla/src/main/kotlin/tools/aqua/stars/importer/carla/carlaToAVConverter.kt b/stars-importer-carla/src/main/kotlin/tools/aqua/stars/importer/carla/carlaToAVConverter.kt index 5290ff65..54796742 100644 --- a/stars-importer-carla/src/main/kotlin/tools/aqua/stars/importer/carla/carlaToAVConverter.kt +++ b/stars-importer-carla/src/main/kotlin/tools/aqua/stars/importer/carla/carlaToAVConverter.kt @@ -223,6 +223,7 @@ fun convertJsonContactAreaToContactArea( lane2StartPos = jsonContactArea.lane2StartPos, lane1 = lane1, lane2 = lane2) + // endregion // region helper diff --git a/stars-importer-carla/src/test/kotlin/tools/aqua/stars/importer/carla/JSONSpeedLimitTest.kt b/stars-importer-carla/src/test/kotlin/tools/aqua/stars/importer/carla/JSONSpeedLimitTest.kt index 90c2c19a..81b6bd56 100644 --- a/stars-importer-carla/src/test/kotlin/tools/aqua/stars/importer/carla/JSONSpeedLimitTest.kt +++ b/stars-importer-carla/src/test/kotlin/tools/aqua/stars/importer/carla/JSONSpeedLimitTest.kt @@ -118,6 +118,7 @@ class JSONSpeedLimitTest { assertEquals(0, getSpeedLimitsFromLandmarks(speedLimitLane, invalidLandmarks).size) } + /** Tests [getSpeedLimitsFromLandmarks] returns 0 if no landmark is given. */ @Test fun testEmptyLandmarksList() {