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

fix(abg): Use "a.to(b)" instead of "a to b" #1607

Merged
merged 1 commit into from
Aug 20, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,9 @@ private fun Metadata.linkedMapOfInputs(inputTypings: Map<String, Typing>): CodeB
inputs.forEach { (key, value) ->
val asStringCode = inputTypings.getInputTyping(key).asString()
if (!value.shouldBeNonNullInBinding()) {
add("%N?.let { %S to it$asStringCode },\n", key.toCamelCase(), key)
add("%N?.let { %S.to(it$asStringCode) },\n", key.toCamelCase(), key)
} else {
add("%S to %N$asStringCode,\n", key, key.toCamelCase())
add("%S.to(%N$asStringCode),\n", key, key.toCamelCase())
}
}
add("*$CUSTOM_INPUTS.%M().%M(),\n", Types.mapToList, Types.listToArray)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,19 @@ public data class ActionWithAllTypesOfInputs private constructor(
@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
"foo-bar" to fooBar,
"baz-goo" to bazGoo.toString(),
binKin?.let { "bin-kin" to it.toString() },
"int-pint" to intPint.toString(),
"flo-pint" to floPint.toString(),
"fin-bin" to finBin.stringValue,
"goo-zen" to gooZen.integerValue.toString(),
"bah-enum" to bahEnum.stringValue,
listStrings?.let { "list-strings" to it.joinToString(",") },
listInts?.let { "list-ints" to it.joinToString(",") { it.toString() } },
listEnums?.let { "list-enums" to it.joinToString(",") { it.stringValue } },
listIntSpecial?.let { "list-int-special" to it.joinToString(",") {
it.integerValue.toString() } },
"foo-bar".to(fooBar),
"baz-goo".to(bazGoo.toString()),
binKin?.let { "bin-kin".to(it.toString()) },
"int-pint".to(intPint.toString()),
"flo-pint".to(floPint.toString()),
"fin-bin".to(finBin.stringValue),
"goo-zen".to(gooZen.integerValue.toString()),
"bah-enum".to(bahEnum.stringValue),
listStrings?.let { "list-strings".to(it.joinToString(",")) },
listInts?.let { "list-ints".to(it.joinToString(",") { it.toString() }) },
listEnums?.let { "list-enums".to(it.joinToString(",") { it.stringValue }) },
listIntSpecial?.let { "list-int-special".to(it.joinToString(",") {
it.integerValue.toString() }) },
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public data class ActionWithDeprecatedInputAndNameClash private constructor(
@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
"fooBar" to fooBar,
"fooBar".to(fooBar),
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public data class ActionWithFancyCharsInDocs private constructor(
@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
nestedKotlinComments?.let { "nested-kotlin-comments" to it },
percent?.let { "percent" to it },
nestedKotlinComments?.let { "nested-kotlin-comments".to(it) },
percent?.let { "percent".to(it) },
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public data class ActionWithInputsSharingType private constructor(
@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
"foo-one" to fooOne.integerValue.toString(),
"foo-two" to fooTwo.integerValue.toString(),
fooThree?.let { "foo-three" to it.integerValue.toString() },
"foo-one".to(fooOne.integerValue.toString()),
"foo-two".to(fooTwo.integerValue.toString()),
fooThree?.let { "foo-three".to(it.integerValue.toString()) },
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public data class ActionWithNoTypings_Untyped private constructor(
@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
"foo" to foo,
bar?.let { "bar" to it },
"foo".to(foo),
bar?.let { "bar".to(it) },
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public data class ActionWithOutputs private constructor(
@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
"foo-bar" to fooBar,
"foo-bar".to(fooBar),
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ public data class ActionWithSomeOptionalInputs private constructor(
@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
fooBar?.let { "foo-bar" to it },
bazGoo?.let { "baz-goo" to it },
zooDar?.let { "zoo-dar" to it },
cooPoo?.let { "coo-poo" to it },
"package" to `package`,
fooBar?.let { "foo-bar".to(it) },
bazGoo?.let { "baz-goo".to(it) },
zooDar?.let { "zoo-dar".to(it) },
cooPoo?.let { "coo-poo".to(it) },
"package".to(`package`),
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public data class SimpleActionWithRequiredStringInputs private constructor(
@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
"foo-bar" to fooBar,
"baz-goo" to bazGoo,
"foo-bar".to(fooBar),
"baz-goo".to(bazGoo),
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)
Expand Down
Loading