diff --git a/platform/inspect/src/com/intellij/codeInspection/inspectionProfile/YamlInspectionProfileRaw.kt b/platform/inspect/src/com/intellij/codeInspection/inspectionProfile/YamlInspectionProfileRaw.kt index 3da32a4fab50..5e037553c673 100644 --- a/platform/inspect/src/com/intellij/codeInspection/inspectionProfile/YamlInspectionProfileRaw.kt +++ b/platform/inspect/src/com/intellij/codeInspection/inspectionProfile/YamlInspectionProfileRaw.kt @@ -64,7 +64,11 @@ private val FIELDS_TO_MERGE = setOf("groups", "inspections") private fun readRaw(reader: Reader, includeReaders: (Path) -> Reader): Map { val yamlReader = Yaml() val rawConfig: Map = yamlReader.load(reader) - val includedConfigs = (rawConfig["include"] as? List<*>)?.filterIsInstance(String::class.java).orEmpty().map { Paths.get(it) } + val includedConfigs = (rawConfig["include"] as? List<*>) + ?.filterIsInstance() + .orEmpty() + .map { Paths.get(it) } + .asReversed() // Values from included placed at the beginning of config. So the first in the list should be added last to keep order. return includedConfigs.fold(rawConfig) { accumulator, path -> val includedYaml = includeReaders.invoke(path).use { includeReader -> diff --git a/platform/inspect/testData/chainedInclude/top/second.yml b/platform/inspect/testData/chainedInclude/top/second.yml index effbcec9708d..aa2c80555d42 100644 --- a/platform/inspect/testData/chainedInclude/top/second.yml +++ b/platform/inspect/testData/chainedInclude/top/second.yml @@ -2,4 +2,5 @@ $schema: https://json.schemastore.org/idea-inspection-profile-1.0.json inspections: - inspection: TodoComment + enabled: false severity: INFO \ No newline at end of file diff --git a/platform/inspect/testData/chainedInclude_profile.xml b/platform/inspect/testData/chainedInclude_profile.xml index 0b373b7339d4..d635de7af720 100644 --- a/platform/inspect/testData/chainedInclude_profile.xml +++ b/platform/inspect/testData/chainedInclude_profile.xml @@ -1,6 +1,6 @@