Skip to content

Commit 69d9c7d

Browse files
committed
ktlint
1 parent b9b99f7 commit 69d9c7d

File tree

17 files changed

+67
-26
lines changed

17 files changed

+67
-26
lines changed

aws-crt-kotlin/build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ kotlin {
199199
}
200200

201201
tasks.withType<KotlinNativeSimulatorTest>().configureEach {
202-
if (!HostManager.hostIsMac) { return@configureEach }
202+
if (!HostManager.hostIsMac) {
203+
return@configureEach
204+
}
203205

204206
dependsOn("bootIosSimulatorDevice")
205207
finalizedBy("shutdownIosSimulatorDevice")

aws-crt-kotlin/common/test/aws/sdk/kotlin/crt/auth/credentials/CredentialsProviderTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import kotlin.test.Ignore
1414
import kotlin.test.Test
1515
import kotlin.test.assertEquals
1616

17-
class CredentialsProviderTest : CrtTest() {
18-
private val EXPECTED_CREDENTIALS = Credentials("access_key_id", "secret_access_key", "session_token")
17+
private val EXPECTED_CREDENTIALS = Credentials("access_key_id", "secret_access_key", "session_token")
1918

19+
class CredentialsProviderTest : CrtTest() {
2020
@Ignore // FIXME Enable when Kotlin/Native implementation is complete
2121
@Test
2222
fun testStaticProvider() = runTest {

aws-crt-kotlin/jvm/src/aws/sdk/kotlin/crt/CRT.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ public actual object CRT {
1818
private val initializerMu = Mutex() // protects `initialized`
1919

2020
public actual fun initRuntime(block: Config.() -> Unit) {
21-
if (initialized) { return }
21+
if (initialized) {
22+
return
23+
}
2224

2325
runBlocking {
2426
initializerMu.withLock {

aws-crt-kotlin/jvm/src/aws/sdk/kotlin/crt/CrtExceptionUtil.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
package aws.sdk.kotlin.crt
77
import software.amazon.awssdk.crt.CrtRuntimeException as CrtRuntimeExceptionJni
88

9-
private class CrtJniExceptionWrapper(wrapped: CrtRuntimeExceptionJni) :
10-
CrtRuntimeException(wrapped.message, wrapped, wrapped.errorCode)
9+
private class CrtJniExceptionWrapper(wrapped: CrtRuntimeExceptionJni) : CrtRuntimeException(wrapped.message, wrapped, wrapped.errorCode)
1110

1211
/**
1312
* Wrap any CRT JNI call exception that happens in [block] into an instance of the kotlin equivalent

aws-crt-kotlin/native/src/aws/sdk/kotlin/crt/Allocator.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ internal object Allocator {
1212
}
1313

1414
@OptIn(ExperimentalForeignApi::class)
15-
internal class AwsAllocator : NativeFreeablePlacement, CValuesRef<aws_allocator>() {
15+
internal class AwsAllocator :
16+
CValuesRef<aws_allocator>(),
17+
NativeFreeablePlacement {
1618
internal val allocator: CPointer<aws_allocator> = s_crt_kotlin_allocator
1719
?: throw CrtRuntimeException("CRT allocator is not initialized, ensure CRT.initRuntime() was called.")
1820

aws-crt-kotlin/native/src/aws/sdk/kotlin/crt/CRTNative.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ public actual object CRT {
2323
*/
2424
public actual fun initRuntime(block: Config.() -> Unit): Unit = runBlocking {
2525
initializerMu.withLock {
26-
if (initialized) { return@runBlocking }
26+
if (initialized) {
27+
return@runBlocking
28+
}
2729

2830
val config = Config().apply(block)
2931

aws-crt-kotlin/native/src/aws/sdk/kotlin/crt/Logging.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ internal object Logging {
1717
private val initializerMu = Mutex() // protects `initialized`
1818

1919
internal fun initialize(config: Config) {
20-
if (initialized) { return }
20+
if (initialized) {
21+
return
22+
}
2123

2224
runBlocking {
2325
initializerMu.withLock {

aws-crt-kotlin/native/src/aws/sdk/kotlin/crt/auth/signing/AwsSignerNative.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ private fun AwsSigningConfig.toNativeSigningConfig(): CPointer<aws_signing_confi
221221
private typealias ShouldSignHeaderFunction = (String) -> Boolean
222222
private fun nativeShouldSignHeaderFn(headerName: CPointer<aws_byte_cursor>?, userData: COpaquePointer?): Boolean {
223223
checkNotNull(headerName) { "aws_should_sign_header_fn expected non-null header name" }
224-
if (userData == null) { return true }
224+
if (userData == null) {
225+
return true
226+
}
225227

226228
val kShouldSignHeaderFn = userData.asStableRef<ShouldSignHeaderFunction>().get()
227229
val kHeaderName = headerName.pointed.toKString()

aws-crt-kotlin/native/src/aws/sdk/kotlin/crt/http/HttpClientConnectionManagerNative.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ import kotlin.coroutines.suspendCoroutine
2323

2424
public actual class HttpClientConnectionManager actual constructor(
2525
public actual val options: HttpClientConnectionManagerOptions,
26-
) : Closeable, AsyncShutdown {
26+
) : Closeable,
27+
AsyncShutdown {
2728
public actual val managerMetrics: HttpManagerMetrics
2829
get() = memScoped {
2930
val metrics = alloc<aws_http_manager_metrics>()

aws-crt-kotlin/native/src/aws/sdk/kotlin/crt/http/HttpClientConnectionNative.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ import platform.posix.size_t
2121
internal class HttpClientConnectionNative(
2222
private val manager: HttpClientConnectionManager,
2323
override val ptr: CPointer<cnames.structs.aws_http_connection>,
24-
) : Closeable, HttpClientConnection, NativeHandle<cnames.structs.aws_http_connection> {
24+
) : Closeable,
25+
HttpClientConnection,
26+
NativeHandle<cnames.structs.aws_http_connection> {
2527

2628
override val id: String = ptr.rawValue.toString()
2729
override fun makeRequest(httpReq: HttpRequest, handler: HttpStreamResponseHandler): HttpStream {

0 commit comments

Comments
 (0)