-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a convenient place to put global configuration of our protos without polluting the .proto files.
- Loading branch information
Showing
34 changed files
with
93 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/gogo/protobuf/protoc-gen-gogo/descriptor" | ||
"github.com/gogo/protobuf/vanity" | ||
"github.com/gogo/protobuf/vanity/command" | ||
) | ||
|
||
func main() { | ||
req := command.Read() | ||
files := req.GetProtoFile() | ||
files = vanity.FilterFiles(files, vanity.NotInPackageGoogleProtobuf) | ||
|
||
for _, opt := range []func(*descriptor.FileDescriptorProto){ | ||
vanity.TurnOffGoGettersAll, | ||
|
||
// Currently harms readability. | ||
// vanity.TurnOffGoEnumPrefixAll, | ||
|
||
// `String() string` is part of gogoproto.Message, so we need this. | ||
// vanity.TurnOffGoStringerAll, | ||
|
||
// Maybe useful for tests? Not using currently. | ||
// vanity.TurnOnVerboseEqualAll, | ||
|
||
// Incompatible with oneof, and also not sure what the value is. | ||
// vanity.TurnOnFaceAll, | ||
|
||
// Requires that all child messages are generated with this, which | ||
// is not the case for Raft messages which wrap raftpb (which | ||
// doesn't use this). | ||
// vanity.TurnOnGoStringAll, | ||
|
||
// Not useful for us. | ||
// vanity.TurnOnPopulateAll, | ||
|
||
// Conflicts with `GoStringerAll`, which is enabled. | ||
// vanity.TurnOnStringerAll, | ||
|
||
// This generates a method that takes `interface{}`, which sucks. | ||
// vanity.TurnOnEqualAll, | ||
|
||
// Not useful for us. | ||
// vanity.TurnOnDescriptionAll, | ||
// vanity.TurnOnTestGenAll, | ||
// vanity.TurnOnBenchGenAll, | ||
|
||
vanity.TurnOnMarshalerAll, | ||
vanity.TurnOnUnmarshalerAll, | ||
vanity.TurnOnSizerAll, | ||
|
||
// Enabling these causes `String() string` on Enums to be inlined. | ||
// Not worth it. | ||
// vanity.TurnOffGoEnumStringerAll, | ||
// vanity.TurnOnEnumStringerAll, | ||
|
||
// Not clear that this is worthwhile. | ||
// vanity.TurnOnUnsafeUnmarshalerAll, | ||
// vanity.TurnOnUnsafeMarshalerAll, | ||
|
||
// Something something extensions; we don't use 'em currently. | ||
// vanity.TurnOffGoExtensionsMapAll, | ||
|
||
vanity.TurnOffGoUnrecognizedAll, | ||
|
||
// Adds unnecessary dependency on golang/protobuf. | ||
// vanity.TurnOffGogoImport, | ||
} { | ||
vanity.ForEachFile(files, opt) | ||
} | ||
|
||
resp := command.Generate(req) | ||
command.Write(resp) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.