dataconnect: add ktfmt support to gradle plugin #6439
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the Data Connect plugin to optionally invoke ktfmt to format the generated code.
This was more of an "experiment" than anything, to see if we ultimately ship a gradle plugin to customers if we can make the generated code look "nicer". Turns out, it works! However, in its current state, customers would be required to download the ktfmt JAR manually and set the path to it. A version that actually got shipped to customers could run ktfmt in-process, like how https://github.com/cortinico/ktfmt-gradle does it. Or, it could download ktfmt on-demand, like it already does for the data connect cli binary.