Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] reformat kotlin files to fix CI as the master branch is broken by it #2829

Merged
merged 2 commits into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ kotlin {
}
}

tasks.withType<KotlinCompile> {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}

Expand All @@ -57,7 +57,7 @@ tasks {

task<Exec>("compileThrift") {
val thriftBin = if (hasProperty("thrift.compiler")) {
file(property("thrift.compiler"))
file(property("thrift.compiler")!!)
} else {
project.rootDir.resolve("../../compiler/cpp/thrift")
}
Expand Down
2 changes: 1 addition & 1 deletion lib/kotlin/cross-test-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ tasks {

task<Exec>("compileThrift") {
val thriftBin = if (hasProperty("thrift.compiler")) {
file(property("thrift.compiler"))
file(property("thrift.compiler")!!)
} else {
project.rootDir.resolve("../../compiler/cpp/thrift")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,12 @@ class TestClient : CliktCommand() {

private fun createProtocol(transport: TTransport): TProtocol =
when (protocolType) {
ProtocolType.Binary, ProtocolType.Multi -> TBinaryProtocol(transport)
ProtocolType.Compact, ProtocolType.MultiCompact -> TCompactProtocol(transport)
ProtocolType.Json, ProtocolType.MultiJson -> TJSONProtocol(transport)
ProtocolType.Binary,
ProtocolType.Multi -> TBinaryProtocol(transport)
ProtocolType.Compact,
ProtocolType.MultiCompact -> TCompactProtocol(transport)
ProtocolType.Json,
ProtocolType.MultiJson -> TJSONProtocol(transport)
}

private fun createTransport(): TNonblockingTransport =
Expand Down Expand Up @@ -283,7 +286,8 @@ class TestClient : CliktCommand() {
if (whoa.size == 2 && whoa.containsKey(1L) && whoa.containsKey(2L)) {
val firstMap = whoa[1L]!!
val secondMap = whoa[2L]!!
if (firstMap.size == 2 &&
if (
firstMap.size == 2 &&
firstMap.containsKey(Numberz.TWO) &&
firstMap.containsKey(Numberz.THREE) &&
secondMap.size == 1 &&
Expand Down Expand Up @@ -361,7 +365,8 @@ class TestClient : CliktCommand() {

private suspend fun multiplexTest(returnCode: Int): Int {
var code = returnCode
if (protocolType == ProtocolType.Multi ||
if (
protocolType == ProtocolType.Multi ||
protocolType == ProtocolType.MultiJson ||
protocolType == ProtocolType.MultiCompact
) {
Expand Down Expand Up @@ -574,7 +579,8 @@ private suspend fun ThriftTestClient.nestedMapTest(returnCode: Int): Int {
} else {
val m1 = mm[4]!!
val m2 = mm[-4]!!
if (m1[1] != 1 ||
if (
m1[1] != 1 ||
m1[2] != 2 ||
m1[3] != 3 ||
m1[4] != 4 ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,12 @@ class TestServerCommand : CliktCommand() {

private fun getProtocolFactory(): TProtocolFactory =
when (protocolType) {
ProtocolType.Json, ProtocolType.MultiJson -> TJSONProtocol.Factory()
ProtocolType.Compact, ProtocolType.MultiCompact ->
TCompactProtocol.Factory(stringLimit, containerLimit)
ProtocolType.Binary, ProtocolType.Multi ->
TBinaryProtocol.Factory(stringLimit, containerLimit)
ProtocolType.Json,
ProtocolType.MultiJson -> TJSONProtocol.Factory()
ProtocolType.Compact,
ProtocolType.MultiCompact -> TCompactProtocol.Factory(stringLimit, containerLimit)
ProtocolType.Binary,
ProtocolType.Multi -> TBinaryProtocol.Factory(stringLimit, containerLimit)
}
}

Expand Down Expand Up @@ -258,7 +259,8 @@ private fun getServerEngine(
multiplexedProcessor.registerProcessor("ThriftTest", testProcessor)
multiplexedProcessor.registerProcessor("SecondService", secondProcessor)
when (serverType) {
ServerType.NonBlocking, ServerType.ThreadedSelector -> {
ServerType.NonBlocking,
ServerType.ThreadedSelector -> {
val tNonblockingServerSocket =
TNonblockingServerSocket(NonblockingAbstractServerSocketArgs().port(port))
when (serverType) {
Expand All @@ -283,7 +285,8 @@ private fun getServerEngine(
}
}
}
ServerType.Simple, ServerType.ThreadPool -> {
ServerType.Simple,
ServerType.ThreadPool -> {
// SSL socket
val tServerSocket: TServerSocket =
if (ssl) {
Expand Down
2 changes: 1 addition & 1 deletion lib/kotlin/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
pluginManagement {
plugins {
kotlin("jvm") version "1.8.21"
kotlin("jvm") version "1.8.22"
id("com.ncorti.ktfmt.gradle") version "0.12.0"
}
}
Expand Down