diff options
author | sebastian.sellmair <sebastian.sellmair@jetbrains.com> | 2020-08-14 12:56:05 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-14 17:51:11 +0200 |
commit | 7f4870484fe9d3ee7f465f77effe58d468b82773 (patch) | |
tree | 569da021cae506070b9723ddbcc12c4103dbbe66 /plugins/base/src | |
parent | 199fca31846be5b561229e6d0c98f11b15fdf003 (diff) | |
download | dokka-7f4870484fe9d3ee7f465f77effe58d468b82773.tar.gz dokka-7f4870484fe9d3ee7f465f77effe58d468b82773.tar.bz2 dokka-7f4870484fe9d3ee7f465f77effe58d468b82773.zip |
Gradle Plugin: Code style improvements
Diffstat (limited to 'plugins/base/src')
-rw-r--r-- | plugins/base/src/main/kotlin/transformers/documentables/ReportUndocumentedTransformer.kt | 11 | ||||
-rw-r--r-- | plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt | 11 |
2 files changed, 11 insertions, 11 deletions
diff --git a/plugins/base/src/main/kotlin/transformers/documentables/ReportUndocumentedTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/ReportUndocumentedTransformer.kt index 7ce21813..ddc0cd37 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/ReportUndocumentedTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/ReportUndocumentedTransformer.kt @@ -100,15 +100,14 @@ internal class ReportUndocumentedTransformer : DocumentableTransformer { } } - fun withAllDependentSourceSets(sourceSet: DokkaSourceSet): Sequence<DokkaSourceSet> { - return sequence { - yield(sourceSet) - for (dependentSourceSet in resolveDependentSourceSets(sourceSet)) { - yieldAll(withAllDependentSourceSets(dependentSourceSet)) - } + fun withAllDependentSourceSets(sourceSet: DokkaSourceSet): Sequence<DokkaSourceSet> = sequence { + yield(sourceSet) + for (dependentSourceSet in resolveDependentSourceSets(sourceSet)) { + yieldAll(withAllDependentSourceSets(dependentSourceSet)) } } + return withAllDependentSourceSets(sourceSet).all { sourceSetOrDependentSourceSet -> documentable.documentation[sourceSetOrDependentSourceSet]?.children?.isEmpty() ?: true } diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index 71c19bbe..0980083a 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -43,9 +43,9 @@ class DefaultPsiToDocumentableTranslator( override fun invoke(sourceSet: DokkaSourceSet, context: DokkaContext): DModule { - fun isFileInSourceRoots(file: File): Boolean { - return sourceSet.sourceRoots.any { root -> file.startsWith(root) } - } + fun isFileInSourceRoots(file: File): Boolean = + sourceSet.sourceRoots.any { root -> file.startsWith(root) } + val (environment, _) = kotlinAnalysis[sourceSet] @@ -298,8 +298,9 @@ class DefaultPsiToDocumentableTranslator( psiParameter.name, DocumentationNode( listOfNotNull(docs.firstChildOfTypeOrNull<Param> { - it.name == psiParameter.name - })).toSourceSetDependent(), + it.name == psiParameter.name + }) + ).toSourceSetDependent(), null, getBound(psiParameter.type), setOf(sourceSetData) |