proto3 pretty printer

224 views
Skip to first unread message

Jason Polis

unread,
Dec 10, 2021, 11:08:08 AM12/10/21
to Protocol Buffers
Is there a pretty printer that will format proto3 consistently
making it easier to compare diffs over the long term ?

Josh Humphries

unread,
Dec 10, 2021, 1:35:15 PM12/10/21
to Jason Polis, Protocol Buffers
At FullStory, we use clang-format to format protobuf code. And we have a custom linter for catching some other style issues, outside of just formatting.

The clang-format tool doesn't have a ton of options for protos, but it's been good enough for our purposes. It can get confused when you have complicated custom options -- like message options, where you put a long message literal as the value -- which can lead to less-than-stellar results, aesthetically speaking.

But having a standard with some warts seemed better than no standard...

----
Josh Humphries
jh...@bluegosling.com


On Fri, Dec 10, 2021 at 11:08 AM Jason Polis <ja...@x-x.net> wrote:
Is there a pretty printer that will format proto3 consistently
making it easier to compare diffs over the long term ?

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/a5807c8b-159a-41b9-a702-1c6398b9edbdn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages