diff --git a/buildSrc/src/main/kotlin/RemotePublishing.kt b/buildSrc/src/main/kotlin/RemotePublishing.kt index 3c1d0f1b2..fb568140a 100644 --- a/buildSrc/src/main/kotlin/RemotePublishing.kt +++ b/buildSrc/src/main/kotlin/RemotePublishing.kt @@ -43,9 +43,9 @@ private object Pgp { } object ProtoktProjectInfo { - const val name = "Protokt" - const val url = "https://github.com/open-toast/protokt" - const val description = "Protobuf compiler and runtime for Kotlin" + const val NAME = "Protokt" + const val URL = "https://github.com/open-toast/protokt" + const val DESCRIPTION = "Protobuf compiler and runtime for Kotlin" } fun Project.isRelease() = !version.toString().endsWith("-SNAPSHOT") @@ -64,10 +64,10 @@ fun Project.enablePublishing(defaultJars: Boolean = true) { configure { pom { - name.set(ProtoktProjectInfo.name) - description.set(ProtoktProjectInfo.description) - url.set(ProtoktProjectInfo.url) - scm { url.set(ProtoktProjectInfo.url) } + name.set(ProtoktProjectInfo.NAME) + description.set(ProtoktProjectInfo.DESCRIPTION) + url.set(ProtoktProjectInfo.URL) + scm { url.set(ProtoktProjectInfo.URL) } licenses { license { name.set("The Apache License, Version 2.0") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 51b0b2cd2..085cd9ca1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -35,7 +35,7 @@ gummyBears = "0.8.0" java = "11" kotlin = "1.9.23" pluginPublish = "1.2.1" -spotless = "6.21.0" +spotless = "6.25.0" # benchmarks datasets = "0.1.0" diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MessageGenerator.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MessageGenerator.kt index aaaa77236..625319cc7 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MessageGenerator.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MessageGenerator.kt @@ -230,7 +230,8 @@ private class MessageGenerator( fun formatDoc(lines: List) = CodeBlock.of( - "%L", // escape the entire comment block + // escape the entire comment block + "%L", lines.joinToString(" ") { if (it.isBlank()) { "\n\n" diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/SerializerGenerator.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/SerializerGenerator.kt index 81348fe3b..af66d3553 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/SerializerGenerator.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/SerializerGenerator.kt @@ -67,7 +67,11 @@ internal fun serialize( interceptValueAccess( f, ctx, - if (f.repeated) { CodeBlock.of("it") } else { CodeBlock.of("%N", p) } + if (f.repeated) { + CodeBlock.of("it") + } else { + CodeBlock.of("%N", p) + } ) } else { interceptValueAccess(f, ctx, CodeBlock.of("%N.%N", o.fieldName, f.fieldName)) diff --git a/protokt-codegen/src/test/kotlin/protokt/v1/codegen/AbstractProtoktCodegenTest.kt b/protokt-codegen/src/test/kotlin/protokt/v1/codegen/AbstractProtoktCodegenTest.kt index fd5b655be..ca21b3b14 100644 --- a/protokt-codegen/src/test/kotlin/protokt/v1/codegen/AbstractProtoktCodegenTest.kt +++ b/protokt-codegen/src/test/kotlin/protokt/v1/codegen/AbstractProtoktCodegenTest.kt @@ -76,7 +76,10 @@ abstract class AbstractProtoktCodegenTest { listOf( System.getenv("PROTOC_PATH") ?: "protoc", "--plugin=protoc-gen-custom=$binGenerator", - "--custom_out=.", // ignored + + // ignored + "--custom_out=.", + "-I$testDir", "-I$extensionsProto", "-I$includeProtos", diff --git a/protokt-gradle-plugin/build.gradle.kts b/protokt-gradle-plugin/build.gradle.kts index b536bf39e..7cbe11e0d 100644 --- a/protokt-gradle-plugin/build.gradle.kts +++ b/protokt-gradle-plugin/build.gradle.kts @@ -21,15 +21,15 @@ plugins { } gradlePlugin { - website.set(ProtoktProjectInfo.url) - vcsUrl.set(ProtoktProjectInfo.url) + website.set(ProtoktProjectInfo.URL) + vcsUrl.set(ProtoktProjectInfo.URL) plugins { create("protokt") { id = "com.toasttab.protokt" implementationClass = "protokt.v1.gradle.ProtoktPlugin" - displayName = ProtoktProjectInfo.name - description = ProtoktProjectInfo.description + displayName = ProtoktProjectInfo.NAME + description = ProtoktProjectInfo.DESCRIPTION tags.set(listOf("protobuf", "kotlin")) } } diff --git a/protokt-runtime-grpc-lite/src/jsMain/kotlin/protokt/v1/grpc/GrpcJs.kt b/protokt-runtime-grpc-lite/src/jsMain/kotlin/protokt/v1/grpc/GrpcJs.kt index ccd36e090..1119dfa98 100644 --- a/protokt-runtime-grpc-lite/src/jsMain/kotlin/protokt/v1/grpc/GrpcJs.kt +++ b/protokt-runtime-grpc-lite/src/jsMain/kotlin/protokt/v1/grpc/GrpcJs.kt @@ -78,6 +78,7 @@ external interface ServerWritableStream : ServerSurfaceCall, Object @Beta external interface ObjectWritable : Writable { + @Suppress("ktlint:standard:function-naming") fun _write(chunk: T, encoding: String, callback: Any) fun write(chunk: T, callback: Any?): Boolean fun write(chunk: T, encoding: Any?, callback: Any?): Boolean diff --git a/testing/testing-util/src/main/kotlin/protokt/v1/testing/ProcessUtils.kt b/testing/testing-util/src/main/kotlin/protokt/v1/testing/ProcessUtils.kt index a73e3266c..5e9b758b2 100644 --- a/testing/testing-util/src/main/kotlin/protokt/v1/testing/ProcessUtils.kt +++ b/testing/testing-util/src/main/kotlin/protokt/v1/testing/ProcessUtils.kt @@ -71,6 +71,7 @@ data class ProcessOutput( } enum class Src { - OUT, ERR + OUT, + ERR } }