Skip to content

Commit c05916b

Browse files
authored
chore: fix warnings (#342)
1 parent a98c056 commit c05916b

File tree

22 files changed

+104
-28
lines changed

22 files changed

+104
-28
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,5 @@ jobs:
5757
run: |
5858
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
5959
chmod a+x builder.pyz
60+
echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties
6061
GIT_ASKPASS="$(pwd)/.github/scripts/git-ci-askpass.sh" ./builder.pyz build -p ${{ env.PACKAGE_NAME }}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,10 @@ kotlin {
4545
implementation("io.kotest:kotest-runner-junit5:$kotestVersion")
4646
}
4747
}
48+
49+
all {
50+
languageSettings.optIn("aws.smithy.kotlin.runtime.util.InternalApi")
51+
languageSettings.optIn("aws.sdk.kotlin.runtime.InternalSdkApi")
52+
}
4853
}
4954
}

aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/config/profile/AwsConfigLoaderTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class AwsConfigLoaderTest {
2727
testCases
2828
.map { TestCase.fromJson(it.jsonObject) }
2929
// .filter { testCase -> testCase.name == "The default config location can be overridden by the user on non-windows platforms." }
30-
.forEachIndexed { index, testCase ->
30+
.forEach { testCase ->
3131
val testPlatform = mockPlatform(testCase)
3232

3333
val actual = resolveConfigSource(testPlatform)

aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/config/profile/AwsConfigParserTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ class AwsProfileParserTest {
154154

155155
return if (!isErrorCase) {
156156
when {
157-
configIn != null && credentialIn != null -> MatchConfigAndCredentialOutputCase(name, configIn!!, credentialIn!!, expected!!)
158-
configIn != null -> MatchConfigOutputCase(name, configIn!!, expected!!)
159-
credentialIn != null -> MatchCredentialOutputCase(name, credentialIn!!, expected!!)
157+
configIn != null && credentialIn != null -> MatchConfigAndCredentialOutputCase(name, configIn, credentialIn, expected!!)
158+
configIn != null -> MatchConfigOutputCase(name, configIn, expected!!)
159+
credentialIn != null -> MatchCredentialOutputCase(name, credentialIn, expected!!)
160160
else -> error("Unexpected branch from $json")
161161
}
162162
} else {

aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/config/profile/ContinuationMergerTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ContinuationMergerTest {
2323
"[profile foo]\ns3 =\n name = value" to "[[profile foo], s3 =\nname = value]",
2424
)
2525

26-
positiveTestCases.forEachIndexed { index, testCase ->
26+
positiveTestCases.forEach { testCase ->
2727
val actual = mergeContinuations(testCase.first).map { it.content }
2828
assertEquals(testCase.second, actual.toString())
2929
}

aws-runtime/aws-config/jvm/test/aws/sdk/kotlin/runtime/config/profile/AWSConfigLoaderFilesystemTest.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ class AWSConfigLoaderFilesystemTest {
3232

3333
@Test
3434
fun itLoadsConfigFileFromFilesystem() = runSuspendTest {
35-
val configFile = tempDir!!.resolve("config")
36-
val credentialsFile = tempDir!!.resolve("credentials")
35+
requireNotNull(tempDir)
36+
val configFile = tempDir.resolve("config")
37+
val credentialsFile = tempDir.resolve("credentials")
3738

3839
configFile.writeText("[profile foo]\nname = value")
3940

@@ -58,8 +59,9 @@ class AWSConfigLoaderFilesystemTest {
5859

5960
@Test
6061
fun itLoadsConfigAndCredsFileFromFilesystem() = runSuspendTest {
61-
val configFile = tempDir!!.resolve("config")
62-
val credentialsFile = tempDir!!.resolve("credentials")
62+
requireNotNull(tempDir)
63+
val configFile = tempDir.resolve("config")
64+
val credentialsFile = tempDir.resolve("credentials")
6365

6466
configFile.writeText("[profile default]\nname = value\n[default]\nname2 = value2\n[profile default]\nname3 = value3")
6567
credentialsFile.writeText("[default]\nsecret=foo")

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,9 @@ kotlin {
2323
implementation(project(":aws-runtime:testing"))
2424
}
2525
}
26+
27+
all {
28+
languageSettings.optIn("aws.smithy.kotlin.runtime.util.InternalApi")
29+
}
2630
}
2731
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,9 @@ kotlin {
1717
implementation(project(":aws-runtime:aws-core"))
1818
}
1919
}
20+
21+
all {
22+
languageSettings.optIn("aws.sdk.kotlin.runtime.InternalSdkApi")
23+
}
2024
}
2125
}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ kotlin {
2424
implementation(project(":aws-runtime:testing"))
2525
}
2626
}
27+
28+
all {
29+
languageSettings.optIn("aws.smithy.kotlin.runtime.util.InternalApi")
30+
languageSettings.optIn("aws.sdk.kotlin.runtime.InternalSdkApi")
31+
}
2732
}
2833
}
29-

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,10 @@ kotlin {
3232
implementation(project(":aws-runtime:testing"))
3333
}
3434
}
35+
36+
all {
37+
languageSettings.optIn("aws.smithy.kotlin.runtime.util.InternalApi")
38+
languageSettings.optIn("aws.sdk.kotlin.runtime.InternalSdkApi")
39+
}
3540
}
3641
}

0 commit comments

Comments
 (0)