Skip to content

Commit 230751e

Browse files
authored
chore: upgrade ktlint and correct license header format (#678)
1 parent a37fa30 commit 230751e

File tree

229 files changed

+690
-658
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+690
-658
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"id": "8e11616b-264a-4d71-ae48-17fb45afd00d",
3+
"type": "bugfix",
4+
"description": "Remove incorrect `.` at end of license identifier header in source files.",
5+
"issues": [
6+
"awslabs/aws-sdk-kotlin#601"
7+
]
8+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"id": "cc986977-c121-4c8b-a3a6-ce5a2ebaae89",
3+
"type": "misc",
4+
"description": "Upgrade ktlint to 0.46.1."
5+
}

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
[*.{kt,kts}]
22
# ktlint rules to disable
33
disabled_rules=no-wildcard-imports,filename
4+
5+
# enable trailing commas per JetBrains recommendation
6+
# (https://kotlinlang.org/docs/coding-conventions.html#trailing-commas)
7+
ij_kotlin_allow_trailing_comma_on_call_site = true
8+
ij_kotlin_allow_trailing_comma = true

.github/scripts/mk-generated.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
#
33
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4-
# SPDX-License-Identifier: Apache-2.0.
4+
# SPDX-License-Identifier: Apache-2.0
55
#
66

77
# Create a branch containing exclusively generated code

aws-runtime/aws-config/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
* SPDX-License-Identifier: Apache-2.0.
3+
* SPDX-License-Identifier: Apache-2.0
44
*/
55
import aws.sdk.kotlin.gradle.codegen.dsl.smithyKotlinPlugin
66
import org.jetbrains.dokka.gradle.DokkaTaskPartial

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/CachedCredentialsProvider.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
* SPDX-License-Identifier: Apache-2.0.
3+
* SPDX-License-Identifier: Apache-2.0
44
*/
55

66
package aws.sdk.kotlin.runtime.auth.credentials
@@ -16,6 +16,7 @@ import kotlin.time.Duration
1616
import kotlin.time.Duration.Companion.seconds
1717

1818
private const val DEFAULT_CREDENTIALS_REFRESH_BUFFER_SECONDS = 10
19+
1920
/**
2021
* The amount of time credentials are valid for before being refreshed when an explicit value
2122
* is not given to/from a provider
@@ -47,7 +48,7 @@ public class CachedCredentialsProvider(
4748
private val source: CredentialsProvider,
4849
private val expireCredentialsAfter: Duration = DEFAULT_CREDENTIALS_REFRESH_SECONDS.seconds,
4950
refreshBufferWindow: Duration = DEFAULT_CREDENTIALS_REFRESH_BUFFER_SECONDS.seconds,
50-
private val clock: Clock = Clock.System
51+
private val clock: Clock = Clock.System,
5152
) : CredentialsProvider, Closeable {
5253

5354
private val cachedCredentials = CachedValue<Credentials>(null, bufferTime = refreshBufferWindow, clock)

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/CredentialsProviderChain.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
* SPDX-License-Identifier: Apache-2.0.
3+
* SPDX-License-Identifier: Apache-2.0
44
*/
55

66
package aws.sdk.kotlin.runtime.auth.credentials
@@ -21,7 +21,7 @@ import aws.smithy.kotlin.runtime.logging.Logger
2121
* @param providers the list of providers to delegate to
2222
*/
2323
public open class CredentialsProviderChain(
24-
protected vararg val providers: CredentialsProvider
24+
protected vararg val providers: CredentialsProvider,
2525
) : CredentialsProvider, Closeable {
2626
private val logger = Logger.getLogger<CredentialsProviderChain>()
2727

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/DefaultChainCredentialsProvider.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
* SPDX-License-Identifier: Apache-2.0.
3+
* SPDX-License-Identifier: Apache-2.0
44
*/
55

66
package aws.sdk.kotlin.runtime.auth.credentials
@@ -40,7 +40,7 @@ import aws.smithy.kotlin.runtime.util.PlatformProvider
4040
public class DefaultChainCredentialsProvider constructor(
4141
private val profileName: String? = null,
4242
private val platformProvider: PlatformProvider = Platform,
43-
httpClientEngine: HttpClientEngine? = null
43+
httpClientEngine: HttpClientEngine? = null,
4444
) : CredentialsProvider, Closeable {
4545

4646
private val manageEngine = httpClientEngine == null
@@ -59,8 +59,8 @@ public class DefaultChainCredentialsProvider constructor(
5959
engine = httpClientEngine
6060
}
6161
},
62-
platformProvider = platformProvider
63-
)
62+
platformProvider = platformProvider,
63+
),
6464
)
6565

6666
private val provider = CachedCredentialsProvider(chain)
@@ -81,7 +81,7 @@ public class DefaultChainCredentialsProvider constructor(
8181
*/
8282
private class StsWebIdentityProvider(
8383
val platformProvider: PlatformProvider,
84-
val httpClientEngine: HttpClientEngine? = null
84+
val httpClientEngine: HttpClientEngine? = null,
8585
) : CredentialsProvider {
8686
override suspend fun getCredentials(): Credentials {
8787
val wrapped = StsWebIdentityCredentialsProvider.fromEnvironment(platformProvider = platformProvider, httpClientEngine = httpClientEngine)

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/EcsCredentialsProvider.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
* SPDX-License-Identifier: Apache-2.0.
3+
* SPDX-License-Identifier: Apache-2.0
44
*/
55

66
package aws.sdk.kotlin.runtime.auth.credentials
@@ -63,7 +63,7 @@ private const val PROVIDER_NAME = "EcsContainer"
6363
*/
6464
public class EcsCredentialsProvider internal constructor(
6565
private val platformProvider: PlatformEnvironProvider,
66-
httpClientEngine: HttpClientEngine? = null
66+
httpClientEngine: HttpClientEngine? = null,
6767
) : CredentialsProvider, Closeable {
6868

6969
public constructor() : this(Platform)
@@ -157,7 +157,7 @@ public class EcsCredentialsProvider internal constructor(
157157

158158
if (url.host !in allowedHosts) {
159159
throw ProviderConfigurationException(
160-
"The container credentials full URI ($uri) has an invalid host. Host can only be one of [${allowedHosts.joinToString()}]."
160+
"The container credentials full URI ($uri) has an invalid host. Host can only be one of [${allowedHosts.joinToString()}].",
161161
)
162162
}
163163
return url
@@ -180,15 +180,15 @@ private class EcsCredentialsDeserializer : HttpDeserialize<Credentials> {
180180
resp.secretAccessKey,
181181
resp.sessionToken,
182182
resp.expiration,
183-
PROVIDER_NAME
183+
PROVIDER_NAME,
184184
)
185185
is JsonCredentialsResponse.Error -> throw CredentialsProviderException("Error retrieving credentials from container service: code=${resp.code}; message=${resp.message}")
186186
}
187187
}
188188
}
189189

190190
private class EcsCredentialsSerializer(
191-
private val authToken: String? = null
191+
private val authToken: String? = null,
192192
) : HttpSerialize<Unit> {
193193
override suspend fun serialize(context: ExecutionContext, input: Unit): HttpRequestBuilder {
194194
val builder = HttpRequestBuilder()

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/EnvironmentCredentialsProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
* SPDX-License-Identifier: Apache-2.0.
3+
* SPDX-License-Identifier: Apache-2.0
44
*/
55

66
package aws.sdk.kotlin.runtime.auth.credentials
@@ -26,6 +26,6 @@ public constructor(private val getEnv: (String) -> String?) : CredentialsProvide
2626
accessKeyId = requireEnv(AwsSdkSetting.AwsAccessKeyId.environmentVariable),
2727
secretAccessKey = requireEnv(AwsSdkSetting.AwsSecretAccessKey.environmentVariable),
2828
sessionToken = getEnv(AwsSdkSetting.AwsSessionToken.environmentVariable),
29-
providerName = PROVIDER_NAME
29+
providerName = PROVIDER_NAME,
3030
)
3131
}

0 commit comments

Comments
 (0)