spotless icon indicating copy to clipboard operation
spotless copied to clipboard

Supporting `buf format`

Open andrewparmet opened this issue 3 years ago • 1 comments

The Buf tool for protobuf recently added the buf format command. Buf is currently published with a download link on their GitHub release page and to DockerHub. They have an open issue to publish binaries to Maven Central.

Is there any precedent for adding a binary tool like this as a formatter? It could be supported with a custom Ivy repository (for Gradle, at least) if that's something you'd be willing to incorporate.

andrewparmet avatar May 12 '22 20:05 andrewparmet

Yes, we have support for two binary tools in Spotless right now, happy to add another one.

https://github.com/diffplug/spotless/blob/21b089f454ed2d50f929af71f1cae52421e32c55/lib/src/main/java/com/diffplug/spotless/python/BlackStep.java#L65-L70

https://github.com/diffplug/spotless/blob/21b089f454ed2d50f929af71f1cae52421e32c55/lib/src/main/java/com/diffplug/spotless/cpp/ClangFormatStep.java#L70-L84

I'm fine with making installation of the buf tool a problem for the user (that's how we handle black and clang currently), or it can be automatic.

nedtwigg avatar May 12 '22 20:05 nedtwigg