protolint icon indicating copy to clipboard operation
protolint copied to clipboard

Rule to separate fields by newline

Open ricsiLT opened this issue 3 years ago • 1 comments

Hi, would it be easy to add a rule that would disallow this:

message Foo {
  // Example 1
  int32 field_one = 1;
  // Example 2
  int32 field_two = 2;
}

and force you to do this:

message Foo {
  // Example 1
  int32 field_one = 1;

  // Example 2
  int32 field_two = 2;
}

ricsiLT avatar Oct 03 '22 06:10 ricsiLT

@ricsiLT Yes. It's possible and not much difficult. You can use the position info of each message field to detect violations.

yoheimuta avatar Oct 09 '22 03:10 yoheimuta