Skip to content

Commit

Permalink
Correct an inconsistency with default values and leave a comment of i…
Browse files Browse the repository at this point in the history
…ntentions
  • Loading branch information
IgnatBeresnev committed Dec 17, 2021
1 parent fec2ebe commit 151ac06
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ class DocumentableVisibilityFilterTransformer(val context: DokkaContext) : PreMe
else -> globalOptions.documentedVisibilities to globalOptions.includeNonPublic
}

// if `documentedVisibilities` is explicitly overridden by the user (i.e. not default value by reference),
// deprecated `includeNonPublic` should not be taken into account, so that only one setting prevails
val isDocumentedVisibilitiesOverridden = documentedVisibilities !== DokkaDefaults.documentedVisibilities
return if (isDocumentedVisibilitiesOverridden) {
documentedVisibilities.contains(visibility)
} else {
visibility == DokkaConfiguration.Visibility.PUBLIC || includeNonPublic
}
return documentedVisibilities.contains(visibility) || (!isDocumentedVisibilitiesOverridden && includeNonPublic)
}

fun processModule(original: DModule) =
Expand Down

0 comments on commit 151ac06

Please sign in to comment.