Skip to content

protocolbuffers/txtpbfmt

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
ast
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Text Proto Formatter

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.

How to format existing text proto files?

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]

What does it do?

Main features:

main features

Is there an API to edit text proto files while preserving comments?

Yes, see ast.go.

How to disable it?

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: { ... }

Which file extension should I use for my text proto files?

The .textproto extension is the most used extension inside Google (the second most popular choice is .textpb).

Which tools support it? How to format on save?

Currently there is no open source integration with any editor.

About

txtpbfmt parses, edits and formats text proto files in a way that preserves comments.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages