aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-07-20 11:13:48 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-07-20 12:02:45 +0200
commit3339d8e0f050b01f122463c3f751f198c10ba42e (patch)
tree76dadc19a4a5897289f296136c2ffef30ed100a1 /core/src/main/kotlin
parentfbed0982653cd20019fe3d56c6b4e5d7e7a72aad (diff)
downloaddokka-3339d8e0f050b01f122463c3f751f198c10ba42e.tar.gz
dokka-3339d8e0f050b01f122463c3f751f198c10ba42e.tar.bz2
dokka-3339d8e0f050b01f122463c3f751f198c10ba42e.zip
Fix style issues introduced with dokka-cli-json
Diffstat (limited to 'core/src/main/kotlin')
-rw-r--r--core/src/main/kotlin/configuration.kt16
-rw-r--r--core/src/main/kotlin/utilities/json.kt16
2 files changed, 12 insertions, 20 deletions
diff --git a/core/src/main/kotlin/configuration.kt b/core/src/main/kotlin/configuration.kt
index 7e4a3d94..88b90ea6 100644
--- a/core/src/main/kotlin/configuration.kt
+++ b/core/src/main/kotlin/configuration.kt
@@ -60,13 +60,9 @@ data class DokkaSourceSetID(
}
}
-fun DokkaConfigurationImpl(json: String): DokkaConfigurationImpl {
- return parseJson(json)
-}
+fun DokkaConfigurationImpl(json: String): DokkaConfigurationImpl = parseJson(json)
-fun DokkaConfiguration.toJsonString(): String {
- return toJsonString(this)
-}
+fun DokkaConfiguration.toJsonString(): String = toJsonString(this)
interface DokkaConfiguration : Serializable {
val outputDir: String
@@ -78,7 +74,7 @@ interface DokkaConfiguration : Serializable {
val pluginsClasspath: List<File>
val pluginsConfiguration: Map<String, String>
- interface DokkaSourceSet: Serializable {
+ interface DokkaSourceSet : Serializable {
val sourceSetID: DokkaSourceSetID
val displayName: String
val moduleDisplayName: String
@@ -104,11 +100,11 @@ interface DokkaConfiguration : Serializable {
val analysisPlatform: Platform
}
- interface SourceRoot: Serializable {
+ interface SourceRoot : Serializable {
val path: String
}
- interface SourceLinkDefinition: Serializable {
+ interface SourceLinkDefinition : Serializable {
val path: String
val url: String
val lineSuffix: String?
@@ -120,7 +116,7 @@ interface DokkaConfiguration : Serializable {
val docFile: String
}
- interface PackageOptions : Serializable{
+ interface PackageOptions : Serializable {
val prefix: String
val includeNonPublic: Boolean
val reportUndocumented: Boolean?
diff --git a/core/src/main/kotlin/utilities/json.kt b/core/src/main/kotlin/utilities/json.kt
index 2096879a..9e4677aa 100644
--- a/core/src/main/kotlin/utilities/json.kt
+++ b/core/src/main/kotlin/utilities/json.kt
@@ -32,7 +32,6 @@ internal class TypeReference<T> private constructor(
internal val jackson: JacksonTypeReference<T>
) {
companion object {
- @OptIn(ExperimentalStdlibApi::class)
internal inline operator fun <reified T> invoke(): TypeReference<T> = TypeReference(jacksonTypeRef())
}
}
@@ -41,14 +40,13 @@ internal class TypeReference<T> private constructor(
internal fun toJsonString(value: Any): String = objectMapper.writeValueAsString(value)
@PublishedApi
-internal inline fun <reified T : Any> parseJson(json: String): T {
- return parseJson(json, TypeReference())
-}
+internal inline fun <reified T : Any> parseJson(json: String): T = parseJson(json, TypeReference())
+
@PublishedApi
-internal fun <T : Any> parseJson(json: String, typeReference: TypeReference<T>): T {
- return objectMapper.readValue(json, typeReference.jackson)
-}
+internal fun <T : Any> parseJson(json: String, typeReference: TypeReference<T>): T =
+ objectMapper.readValue(json, typeReference.jackson)
+
private object FileSerializer : StdScalarSerializer<File>(File::class.java) {
override fun serialize(value: File, g: JsonGenerator, provider: SerializerProvider) {
@@ -63,7 +61,5 @@ private object SourceRootSerializer : StdScalarSerializer<SourceRoot>(SourceRoot
}
private object SourceRootImplDeserializer : StdScalarDeserializer<SourceRootImpl>(SourceRootImpl::class.java) {
- override fun deserialize(p: JsonParser, ctxt: DeserializationContext): SourceRootImpl {
- return SourceRootImpl(p.text)
- }
+ override fun deserialize(p: JsonParser, ctxt: DeserializationContext): SourceRootImpl = SourceRootImpl(p.text)
}