commit | 1e18ef0a7fdc4d28b9223d2d50b4b2be7024519e | [log] [tgz] |
---|---|---|
author | txtpbfmt team <txtpbfmt-copybara-robot@google.com> | Tue Apr 16 19:36:34 2024 |
committer | txtpbfmt team <txtpbfmt-copybara-robot@google.com> | Tue Apr 16 19:37:09 2024 |
tree | 31f08be87320ba1efac91a34caa3898efddd1a1b | |
parent | ef3ab179eed6fa957093608ca1ddef8b0bd48181 [diff] |
Make quote symbol preserved in multiline quoted strings. PiperOrigin-RevId: 625419105
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:
Configurable features:
parser.Config
# txtpbfmt: feature
names on parser.addToConfig
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.