commit | fa9f017c0ded2ef73ccab6b508300ee35989355d | [log] [tgz] |
---|---|---|
author | KauĂȘ Soares da Silveira <kaue@google.com> | Wed Apr 12 06:04:55 2023 |
committer | txtpbfmt team <txtpbfmt-copybara-robot@google.com> | Wed Apr 12 06:05:25 2023 |
tree | 77777995c3aa145d6a683c01482ef76ea8920f4b | |
parent | 7962e1995b09690ec74fee8d4ec9564ce03f2a13 [diff] |
trim trailing newlines PiperOrigin-RevId: 523610372
txtpbfmt
parses, edits and formats text proto files in a way that preserves comments.
This saves development (read/edit/review) time and enables automated edits.
Install:
$ go install github.com/protocolbuffers/txtpbfmt/cmd/txtpbfmt@latest
Format files in-place:
$ ${GOPATH}/bin/txtpbfmt [FILES]
Write formatted input to stdout:
$ ${GOPATH}/bin/txtpbfmt < [FILE]
Main features:
Yes, see ast.go.
You can disable formatting for a whole file by adding a comment with “# txtpbfmt: disable” to the top of the file (before the first non-empty non-comment line), eg:
# File overview ... # txtpbfmt: disable content: { ... }
The .textproto
extension is the most used extension inside Google (the second most popular choice is .textpb
).
Currently there is no open source integration with any editor.