commit | 8830a5005fb0851a23c03326f258641c4709ebee | [log] [tgz] |
---|---|---|
author | txtpbfmt team <txtpbfmt-copybara-robot@google.com> | Tue Apr 26 18:23:47 2022 |
committer | txtpbfmt team <txtpbfmt-copybara-robot@google.com> | Tue Apr 26 18:24:10 2022 |
tree | b6e488ea9c9f788704466815e83a0b7bd0df72ad | |
parent | d629130a421733ae58684fb8a6e16e1dad62f335 [diff] |
Allow sorting by a user-specified field order. PiperOrigin-RevId: 444615649
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.