Skip to content

Commit af3bee6

Browse files
committed
lint
1 parent 561cc65 commit af3bee6

File tree

5 files changed

+41
-30
lines changed

5 files changed

+41
-30
lines changed

hll/dynamodb-mapper/dynamodb-mapper-annotations/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ kotlin {
1616
}
1717
}
1818
}
19-
}
19+
}

hll/dynamodb-mapper/dynamodb-mapper-schema-codegen/src/main/kotlin/aws/sdk/kotlin/hll/dynamodbmapper/codegen/annotations/rendering/SchemaRenderer.kt

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -228,28 +228,31 @@ internal class SchemaRenderer(
228228

229229
type.isGenericFor(Types.Kotlin.Collections.Set) -> writeInline("#T", ksType.singleArgument().setValueConverter)
230230

231-
else -> writeInline("#T", when (type) {
232-
Types.Smithy.Instant -> MapperTypes.Values.SmithyTypes.DefaultInstantValueConverter
233-
Types.Smithy.Url -> MapperTypes.Values.SmithyTypes.UrlValueConverter
234-
Types.Smithy.Document -> MapperTypes.Values.SmithyTypes.DefaultDocumentValueConverter
235-
236-
Types.Kotlin.Boolean -> MapperTypes.Values.Scalars.BooleanValueConverter
237-
Types.Kotlin.String -> MapperTypes.Values.Scalars.StringValueConverter
238-
Types.Kotlin.CharArray -> MapperTypes.Values.Scalars.CharArrayValueConverter
239-
Types.Kotlin.Char -> MapperTypes.Values.Scalars.CharValueConverter
240-
Types.Kotlin.Byte -> MapperTypes.Values.Scalars.ByteValueConverter
241-
Types.Kotlin.ByteArray -> MapperTypes.Values.Scalars.ByteArrayValueConverter
242-
Types.Kotlin.Short -> MapperTypes.Values.Scalars.ShortValueConverter
243-
Types.Kotlin.Int -> MapperTypes.Values.Scalars.IntValueConverter
244-
Types.Kotlin.Long -> MapperTypes.Values.Scalars.LongValueConverter
245-
Types.Kotlin.Double -> MapperTypes.Values.Scalars.DoubleValueConverter
246-
Types.Kotlin.Float -> MapperTypes.Values.Scalars.FloatValueConverter
247-
Types.Kotlin.UByte -> MapperTypes.Values.Scalars.UByteValueConverter
248-
Types.Kotlin.UInt -> MapperTypes.Values.Scalars.UIntValueConverter
249-
Types.Kotlin.UShort -> MapperTypes.Values.Scalars.UShortValueConverter
250-
Types.Kotlin.ULong -> MapperTypes.Values.Scalars.ULongValueConverter
251-
else -> error("Unsupported attribute type $type")
252-
})
231+
else -> writeInline(
232+
"#T",
233+
when (type) {
234+
Types.Smithy.Instant -> MapperTypes.Values.SmithyTypes.DefaultInstantValueConverter
235+
Types.Smithy.Url -> MapperTypes.Values.SmithyTypes.UrlValueConverter
236+
Types.Smithy.Document -> MapperTypes.Values.SmithyTypes.DefaultDocumentValueConverter
237+
238+
Types.Kotlin.Boolean -> MapperTypes.Values.Scalars.BooleanValueConverter
239+
Types.Kotlin.String -> MapperTypes.Values.Scalars.StringValueConverter
240+
Types.Kotlin.CharArray -> MapperTypes.Values.Scalars.CharArrayValueConverter
241+
Types.Kotlin.Char -> MapperTypes.Values.Scalars.CharValueConverter
242+
Types.Kotlin.Byte -> MapperTypes.Values.Scalars.ByteValueConverter
243+
Types.Kotlin.ByteArray -> MapperTypes.Values.Scalars.ByteArrayValueConverter
244+
Types.Kotlin.Short -> MapperTypes.Values.Scalars.ShortValueConverter
245+
Types.Kotlin.Int -> MapperTypes.Values.Scalars.IntValueConverter
246+
Types.Kotlin.Long -> MapperTypes.Values.Scalars.LongValueConverter
247+
Types.Kotlin.Double -> MapperTypes.Values.Scalars.DoubleValueConverter
248+
Types.Kotlin.Float -> MapperTypes.Values.Scalars.FloatValueConverter
249+
Types.Kotlin.UByte -> MapperTypes.Values.Scalars.UByteValueConverter
250+
Types.Kotlin.UInt -> MapperTypes.Values.Scalars.UIntValueConverter
251+
Types.Kotlin.UShort -> MapperTypes.Values.Scalars.UShortValueConverter
252+
Types.Kotlin.ULong -> MapperTypes.Values.Scalars.ULongValueConverter
253+
else -> error("Unsupported attribute type $type")
254+
},
255+
)
253256
}
254257
}
255258

hll/dynamodb-mapper/dynamodb-mapper-schema-generator-plugin/src/test/kotlin/aws/sdk/kotlin/hll/dynamodbmapper/plugins/SchemaGeneratorPluginTest.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,22 +584,26 @@ class SchemaGeneratorPluginTest {
584584
val schemaContents = schemaFile.readText()
585585

586586
assertContains(schemaContents, "import org.example.OccupationConverter")
587-
assertContains(schemaContents,
587+
assertContains(
588+
schemaContents,
588589
""" AttributeDescriptor(
589590
"occupation",
590591
Employee::occupation,
591592
Employee::occupation::set,
592593
org.example.OccupationConverter(),
593-
),""")
594+
),""",
595+
)
594596

595597
// Test cross-package converter
596598
assertContains(schemaContents, "import a.different.pkg.HealthcareConverter")
597-
assertContains(schemaContents,
599+
assertContains(
600+
schemaContents,
598601
""" AttributeDescriptor(
599602
"healthcare",
600603
Employee::healthcare,
601604
Employee::healthcare::set,
602605
a.different.pkg.HealthcareConverter(),
603-
),""")
606+
),""",
607+
)
604608
}
605609
}

hll/dynamodb-mapper/dynamodb-mapper-schema-generator-plugin/src/test/resources/attribute-converter/Employee.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55

66
package org.example
77

8+
import a.different.pkg.HealthcareConverter
89
import aws.sdk.kotlin.hll.dynamodbmapper.DynamoDbAttributeConverter
910
import aws.sdk.kotlin.hll.dynamodbmapper.DynamoDbItem
1011
import aws.sdk.kotlin.hll.dynamodbmapper.DynamoDbPartitionKey
1112
import aws.sdk.kotlin.hll.dynamodbmapper.values.ValueConverter
1213
import aws.sdk.kotlin.hll.mapping.core.converters.MonoConverter
1314
import aws.sdk.kotlin.services.dynamodb.model.AttributeValue
14-
import org.example.OccupationConverter
15-
import a.different.pkg.HealthcareConverter
1615

1716
@DynamoDbItem
1817
data class Employee(
@@ -25,7 +24,7 @@ data class Employee(
2524
var occupation: Occupation = Occupation("Student", 0),
2625

2726
@property:DynamoDbAttributeConverter(HealthcareConverter::class)
28-
var healthcare: Healthcare = Healthcare(false)
27+
var healthcare: Healthcare = Healthcare(false),
2928
)
3029

3130
data class Occupation(val title: String, val salary: Int)

hll/dynamodb-mapper/dynamodb-mapper-schema-generator-plugin/src/test/resources/attribute-converter/HealthcareConverter.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
package a.different.pkg
27

38
import aws.sdk.kotlin.hll.dynamodbmapper.values.ValueConverter

0 commit comments

Comments
 (0)