kotlinpoet
kotlinpoet copied to clipboard
A Kotlin API for generating .kt source files.
This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. ## Edited/Blocked These updates have been manually edited so Renovate will no longer make...
Probably a relict of JavaPoet where a control flow would almost certainly be followed by new line. With Kotlin, new line by default makes code like below look bad: ```kotlin...
``` buildCodeBlock { add("return %T(", Whatever::class) } ``` Even though this uses KClass, I get this error when running e.g. `kspKotlinIosArm64` ``` java.lang.NoClassDefFoundError: javax/lang/model/type/TypeMirror at com.squareup.kotlinpoet.CodeBlock$Builder.argToType(CodeBlock.kt:377) at com.squareup.kotlinpoet.CodeBlock$Builder.addArgument(CodeBlock.kt:346) at com.squareup.kotlinpoet.CodeBlock$Builder.add(CodeBlock.kt:318)...
Treating all spaces as wrapping by default leads to shorter lines and better formatting overall, but in certain cases can break compilation (there's a large number of issues mentioning this...
Today: ```kotlin public override val descriptor: SerialDescriptor = buildString { } ``` ```kotlin public override val descriptor: SerialDescriptor = buildClassSerialDescriptor("RowVerticalAlignment") { } ``` Should be: ```kotlin public override val descriptor:...
Publishing releases manually is not straightforward and not secure, let's do better. We should have enough tools available to us to automate the entire process. Here's the proposed workflow: 1....
Thankfully it's not a warning, but the IDE still soft warns about it:
## (WIP, not ready for review yet) In 1.0, our `TypeName` modeling is largely based on JavaPoet's. This mostly works, but falls short in some ways that don't map well...
From https://kotlinlang.org/docs/whatsnew17.html#stable-definitely-non-nullable-types Open to suggestions on the API for this, went back and forth on an explicit `asDefinitelyNonNullable()` or `copy(isDefinitelyNonNullable: Boolean)` overload. Also open to suggestions on whether or not...
This feature has been promoted to Stable in 1.7.0 ([announcement](https://kotlinlang.org/docs/whatsnew17.html#stable-definitely-non-nullable-types), [KEEP](https://github.com/Kotlin/KEEP/blob/c72601cf35c1e95a541bb4b230edb474a6d1d1a8/proposals/definitely-non-nullable-types.md)). Example: ```kotlin fun elvisLike(x: T, y: T & Any): T & Any = x ?: y fun main() {...