commit | 0e3c6a01a2113bb00ec28638cc1271484c44513a | [log] [tgz] |
---|---|---|
author | txtpbfmt team <txtpbfmt-copybara-robot@google.com> | Wed Mar 08 17:50:02 2023 |
committer | txtpbfmt team <txtpbfmt-copybara-robot@google.com> | Wed Mar 08 17:50:31 2023 |
tree | ec9584e1dfdab450f129249c439c8123b9ec4840 | |
parent | 9485b87fd499cd59e83aef1f4ac4a9ba1aa3a174 [diff] |
Allow <stdin> to be called something else in log/error messages PiperOrigin-RevId: 515064137
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.