From 970f3163336f20143a5a49b8eb1110f3df60a586 Mon Sep 17 00:00:00 2001 From: Arrgentum <79669665+Arrgentum@users.noreply.github.com> Date: Fri, 11 Mar 2022 12:27:07 +0300 Subject: [PATCH] Bugfix/invalid override enabled (#1223) * Usability of diktat-analysis: invalid override ### What's done: - Corrected the order of inclusion of rules (#1146) Co-authored-by: Alexey Votintsev --- .../cqfn/diktat/common/config/rules/RulesConfigReader.kt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/diktat-common/src/main/kotlin/org/cqfn/diktat/common/config/rules/RulesConfigReader.kt b/diktat-common/src/main/kotlin/org/cqfn/diktat/common/config/rules/RulesConfigReader.kt index 41c75da124..ee3c5a054b 100644 --- a/diktat-common/src/main/kotlin/org/cqfn/diktat/common/config/rules/RulesConfigReader.kt +++ b/diktat-common/src/main/kotlin/org/cqfn/diktat/common/config/rules/RulesConfigReader.kt @@ -70,7 +70,7 @@ open class RulesConfigReader(override val classLoader: ClassLoader) : JsonResour */ @OptIn(ExperimentalSerializationApi::class) override fun parseResource(fileStream: BufferedReader): List = fileStream.use { stream -> - yamlSerializer.decodeFromString(stream.readLines().joinToString(separator = "\n")) + yamlSerializer.decodeFromString>(stream.readLines().joinToString(separator = "\n")).reversed().distinctBy { it.name } } /** @@ -153,11 +153,6 @@ data class CommonConfiguration(private val configuration: Map?) srcDirs } - /** - * False if configuration has been read from config file, true if defaults are used - */ - val isDefault = configuration == null - companion object { /** * Counter that helps not to raise multiple warnings about kotlin version