如何使用 clang-format 更好地格式化 protobuf 文件?
How to format protobuf file more nicely using clang-format?
我正在很好地格式化我的 porotbuf 文件,这里是一个例子:
message StealCache {
string CurStealTargetUID = 1;
uint32 CurStealMoney = 2;
repeated TargetList TargetLists = 3;
uint32 Count = 4;
uint32 Timestamp = 5;
StealTreasureBox StealBox = 6;
uint32 ExtraStealMoney = 7;
}
当前的 clang-format 样式标签是:
{BasedOnStyle: Google,
AlignConsecutiveDeclarations: true,
AlignConsecutiveAssignments: true,
ColumnLimit: 0,
IndentWidth: 4}
但是我想要的是这样的:
message StealCache {
string CurStealTargetUID = 1;
uint32 CurStealMoney = 2;
repeated TargetList TargetLists = 3;
uint32 Count = 4;
uint32 Timestamp = 5;
StealTreasureBox StealBox = 6;
uint32 ExtraStealMoney = 7;
}
如何修改我的 clang-format 样式?
升级 llvm(9.0.0) 后问题已解决。
我正在很好地格式化我的 porotbuf 文件,这里是一个例子:
message StealCache {
string CurStealTargetUID = 1;
uint32 CurStealMoney = 2;
repeated TargetList TargetLists = 3;
uint32 Count = 4;
uint32 Timestamp = 5;
StealTreasureBox StealBox = 6;
uint32 ExtraStealMoney = 7;
}
当前的 clang-format 样式标签是:
{BasedOnStyle: Google,
AlignConsecutiveDeclarations: true,
AlignConsecutiveAssignments: true,
ColumnLimit: 0,
IndentWidth: 4}
但是我想要的是这样的:
message StealCache {
string CurStealTargetUID = 1;
uint32 CurStealMoney = 2;
repeated TargetList TargetLists = 3;
uint32 Count = 4;
uint32 Timestamp = 5;
StealTreasureBox StealBox = 6;
uint32 ExtraStealMoney = 7;
}
如何修改我的 clang-format 样式?
升级 llvm(9.0.0) 后问题已解决。