commit | 34aaec5a6358e85c45464ca16660986979f4debb | [log] [tgz] |
---|---|---|
author | txtpbfmt team <no-reply@google.com> | Fri Jun 11 23:59:51 2021 |
committer | txtpbfmt team <txtpbfmt-copybara-robot@google.com> | Sun Jun 27 02:42:59 2021 |
tree | 6b10fba5c2cf865be10a4231dcb4ff94a1bda4f3 | |
parent | 408574485efafaec71ca8ff5fb6362b5bbf82c44 [diff] |
Internal change PiperOrigin-RevId: 378976528
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 get -u github.com/protocolbuffers/txtpbfmt/cmd/txtpbfmt
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.