commit | 4aa4343d0a6ebd70b0b013158f55ca88b3bde294 | [log] [tgz] |
---|---|---|
author | Kau? Soares da Silveira <kaue@google.com> | Tue Oct 01 08:28:31 2019 |
committer | txtpbfmt team <txtpbfmt-copybara-robot@google.com> | Tue Oct 01 08:28:50 2019 |
tree | cb24f3d1447201d658ad4c89f40c26669ee14be0 | |
parent | 91b5148b0328c588eef47cd0e5564480cc6fcee8 [diff] |
Add config to allow unnamed nodes everywhere. Also some refactorings: - Make parser struct have the whole config. - Change defConfig to use the implicit default values. - Make metaComments also apply to Parse(). - Delete parse(). PiperOrigin-RevId: 272158388
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.