DEV Community

Discussion on: Protocol buffer deep-dive

Collapse
 
leonistor profile image
Leo Nistor

Add .clang-format file in project root folder (not proto folder):

Language: Proto

AlignConsecutiveAssignments: true
Enter fullscreen mode Exit fullscreen mode

to configure clang-format to vertically align assignments like this:

message CPU {
  string brand          = 1;
  string name           = 2;
  uint32 cores          = 3;
  uint32 number_threads = 4;
  double min_ghz        = 5;
  double max_ghz        = 6;
}

message GPU {
  string brand   = 1;
  string name    = 2;
  double min_ghz = 3;
  double max_ghz = 4;
  Memory memory  = 5;
}

Enter fullscreen mode Exit fullscreen mode