commit | 7e3b7136cc9ff90f3b33c7a207fa96bcb964048a | [log] [tgz] |
---|---|---|
author | txtpbfmt team <txtpbfmt-copybara-robot@google.com> | Mon Mar 27 18:03:24 2023 |
committer | txtpbfmt team <txtpbfmt-copybara-robot@google.com> | Mon Mar 27 18:03:53 2023 |
tree | ee336d5f540fb2ef2009aa006e14d4ab3687ad6d | |
parent | 0e3c6a01a2113bb00ec28638cc1271484c44513a [diff] |
Auto-disable WrapStringsAfterNewlines for binary-ish strings. PiperOrigin-RevId: 519773224
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.