From 777b1ff638cb2c0bc25201efb3c8b244177d0047 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Tue, 28 Nov 2023 14:33:01 +0100 Subject: [PATCH] refactor(compare-command): Move an `enum classs` closer to its use While the `enum class` does not need command context, a nested class in Kotlin does not have outer class context anyway (only `inner` classes have), so it does not hurt to scope the enum to the command where it is being used. Signed-off-by: Sebastian Schuberth --- plugins/commands/compare/src/main/kotlin/CompareCommand.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/commands/compare/src/main/kotlin/CompareCommand.kt b/plugins/commands/compare/src/main/kotlin/CompareCommand.kt index 62701887b8c55..7a982a64b6ad2 100644 --- a/plugins/commands/compare/src/main/kotlin/CompareCommand.kt +++ b/plugins/commands/compare/src/main/kotlin/CompareCommand.kt @@ -51,6 +51,8 @@ class CompareCommand : OrtCommand( name = "compare", help = "Compare two ORT results with various methods." ) { + private enum class CompareMethod { SEMANTIC_DIFF, TEXT_DIFF } + private val fileA by argument(help = "The first ORT result file to compare.") .convert { it.expandTilde() } .file(mustExist = true, canBeFile = true, canBeDir = false, mustBeWritable = false, mustBeReadable = true) @@ -166,11 +168,6 @@ class CompareCommand : OrtCommand( } } -private enum class CompareMethod { - SEMANTIC_DIFF, - TEXT_DIFF -} - private class EpochInstantDeserializer : StdDeserializer(Instant::class.java) { override fun deserialize(parser: JsonParser, context: DeserializationContext): Instant = Instant.EPOCH.also {