Hello 👋
I’m using KotlinPoet, and can’t find one feature. In the IDE I can “Reformat file”, which will use all my code styles from settings, like indents, braces, ets. Is there a way to do the same with
FileSpec
?
j
jessewilson
04/14/2021, 8:37 AM
Nope. KotlinPoet emits files formatted well enough to be human readable, but we've decided it's not worth the code complexity or the runtime cost to do more
👌 1
Dagger 2 used to spend like 50% of it's time formatting the generated code and it was a bad tradeoff when a developer is waiting
I was thinking of the same thing and considering using ktlint or maybe Psi directly to reformat source after it's been generated by KotlinPoet. No idea how easy/hard that is but it feels theoretically doable.