Skip to content

Commit

Permalink
Update spotless gradle plugin to fix false detekt warnings (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
tillschallau authored Nov 6, 2024
1 parent d60d30e commit 41a7410
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class PredicateContext<
private val binaryPredicateCache:
MutableMap<Pair<BinaryPredicate<*, *, E, T, S, U, D>, Triple<U, Int, Int>>, Boolean> =
mutableMapOf()

// TODO: Check if the caches are still "useful" and actually used.

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ class ValidTSCInstancesPerTSCMetric<
yAxisScaleMaxValue = 100,
fileName = "${plotFileNameCombinedPercentage}_scaled")
}

// endregion

// region CSV files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class FailedMonitorsMetric<
val failedMonitors:
MutableMap<TSC<E, T, S, U, D>, List<TSCFailedMonitorInstance<E, T, S, U, D>>> =
mutableMapOf()

/**
* Calculates a [Map] of [TSCFailedMonitorInstance]s for all [TSC]s by validating all monitors for
* all valid [TSCInstance]s.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ val baseline: Map<String, List<SerializableResult>>
*/
fun getBaselineSerializationResultDirectory(): File? =
File(serializedResultsFolder).listFiles()?.firstOrNull { it.name == baselineDirectory }

// endregion

// region previous Results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class SerializationHelpersTest {
assertEquals(actualFileContent, actualFile.readText())
assertEquals(actualFile, resultPath)
}

// endregion

// region Tests for saveAsJsonFile(SerializableResult)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -264,6 +267,7 @@ class SerializationHelpersTest {

assertNull(latestResult)
}

// endregion

// region Tests for getBaselineSerializationResultPath()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class TSCDuplicatedLabelsTest {
}
}
}

// endregion
// region projection labels
/** Test duplicated projection labels on same level throwing exception. */
Expand Down Expand Up @@ -98,6 +99,7 @@ class TSCDuplicatedLabelsTest {
}
}
}

// endregion
// region monitor labels
/** Test duplicated monitor labels on same level throwing exception. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class TSCRootTest {
SimpleTickDataDifference> {}
}
}

// endregion

// region Test adding simple true conditions to root note
Expand Down Expand Up @@ -180,6 +181,7 @@ class TSCRootTest {
}
}
}

// endregion

// region Test adding simple false conditions to root note
Expand Down Expand Up @@ -272,6 +274,7 @@ class TSCRootTest {
}
}
}

// endregion

// region Test adding complex true conditions to root note
Expand Down Expand Up @@ -364,6 +367,7 @@ class TSCRootTest {
}
}
}

// endregion

// region Test adding complex false conditions to root note
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ fun convertJsonContactAreaToContactArea(
lane2StartPos = jsonContactArea.lane2StartPos,
lane1 = lane1,
lane2 = lane2)

// endregion

// region helper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class JSONSpeedLimitTest {

assertEquals(0, getSpeedLimitsFromLandmarks(speedLimitLane, invalidLandmarks).size)
}

/** Tests [getSpeedLimitsFromLandmarks] returns 0 if no landmark is given. */
@Test
fun testEmptyLandmarksList() {
Expand Down

0 comments on commit 41a7410

Please sign in to comment.