Skip to content

Commit

Permalink
Usability of diktat-analysis: invalid override
Browse files Browse the repository at this point in the history
### What's done:
- Corrected the order of inclusion of rules

(#1146)
  • Loading branch information
Alexey Votintsev committed Mar 4, 2022
1 parent c3c960f commit b1b7fb8
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ open class RulesConfigReader(override val classLoader: ClassLoader) : JsonResour
*/
@OptIn(ExperimentalSerializationApi::class)
override fun parseResource(fileStream: BufferedReader): List<RulesConfig> = fileStream.use { stream ->
yamlSerializer.decodeFromString(stream.readLines().joinToString(separator = "\n"))
yamlSerializer.decodeFromString<List<RulesConfig>>(stream.readLines().joinToString(separator = "\n")).reversed().distinctBy{it.name}
}

/**
Expand Down Expand Up @@ -152,12 +152,7 @@ data class CommonConfiguration(private val configuration: Map<String, String>?)
}
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
Expand Down

0 comments on commit b1b7fb8

Please sign in to comment.