Skip to content

Commit

Permalink
Fix filtering suppresed extensions (#2348)
Browse files Browse the repository at this point in the history
  • Loading branch information
BarkingBad committed Feb 14, 2022
1 parent a43e11e commit 8ed821a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/main/kotlin/plugability/DokkaContext.kt
Expand Up @@ -124,7 +124,11 @@ private class DokkaContextConfigurationImpl(
}

private fun findNotOverridden(bucket: Set<Extension<*, *, *>>): Extension<*, *, *> {
val filtered = bucket.filter { it !in suppressedExtensions }
// Let's filter out all suppressedExtensions that are not only overrides.
// suppressedExtensions can be polluted by suppressions that completely disables the extension, and would break dokka behaviour
// if not filtered out
val suppressedExtensionsByOverrides = suppressedExtensions.filterNot { it.value.any { it !is Suppression.ByExtension } }
val filtered = bucket.filterNot { it in suppressedExtensionsByOverrides }
return filtered.singleOrNull()
?: throw IllegalStateException("Conflicting overrides: $filtered")
}
Expand Down

0 comments on commit 8ed821a

Please sign in to comment.