Closed hexchain closed 1 month ago
@llvm/issue-subscribers-clang-format
this problem still occur
this problem still occur
Which version did you use? It seems to work with 18.1.8.
this problem still occur
Which version did you use? It seems to work with 18.1.8.
clang-format: version 18.1.8
os: Apple M2 & OS 14.5 (23F79)
Using clang-format on .proto
file:
proto:
message Req {
repeated string IDs = 1 [(validate.rules).repeated.min_items = 1];
}
command:
clang-format -style="{ IndentWidth: 4, BasedOnStyle: google, AlignConsecutiveAssignments: AcrossEmptyLines, AlignConsecutiveDeclarations: AcrossEmptyLines, ColumnLimit: 0, Language: Proto }"
got:
message Req {
repeated string IDs = 1 [(validate.rules).repeated .min_items = 1];
}
There is a space between repeated
and .min_items
@llvm/issue-subscribers-bug
Author: hexchain (hexchain)
Protobuf keywords may appear in a field option, e.g. https://github.com/envoyproxy/protoc-gen-validate/blob/main/README.md#repeated. When formatting a file with such field option,
clang-format
insists on inserting a space after the "keyword".Example file:
Output of
clang-format --style=Google
:Expected output:
No space should be inserted after "keywords" in a field option.