<@U0BFDUP0E> does KotlinPoet handle formatting the...
# announcements
e
@jw does KotlinPoet handle formatting the output?
j
What do you mean? It produces formatted code.
e
well, the question is probably poorly formed. ironically.
but the output will group the properties together, and the functions in another, etc. with the indentation on the functions normalized, etc. ?
j
It groups, yes.
And it indents the structure but not the contents of functions
You're responsible for that using a CodeBlock which has indent/unindent methods.
And methods like control flow auto-indent
Basically check out the tests for examples
e
ok. i have the same-ish issue in kibble. i was trying to decide if it made sense to use kotlinpoet for the generation and have kibble just add the parsing functionality on top.
j
Or just run Ktlint on the output to format it when you are done generating it? https://ktlint.github.io/
e
oooh. i was unaware of that one...
j
Its the only one as far as I'm aware of.
j
I would be curious what you think isn't handled by KotlinPoet. I'm super annoyed that Dagger runs google-java-format after JavaPoet. It's a waste of time. I'd rather fix the tool to produce better output.
Please file bugs if you find things
e
i'm of a similar mind with kibble. i try to produce the best output i can but I'd given some thought to an optional run of an external tool at the end. but i suppose that could be a build time concern/dependency rather than anything I need to worry about.