我有以下代码,例如:
[cardRegistrationVC setCancelBlock:^{
[weakSelf.navigationController popViewControllerAnimated:YES];
}];
当我对其应用 clang-format 时,它变成:
[cardRegistrationVC setCancelBlock:^{ [weakSelf.navigationController popViewControllerAnimated:YES]; }];
如您所见,块内的代码出现在同一行。但我应该总是在一个新的路线上。
如何正确设置 clang-format?我的以下设置文件:
BasedOnStyle: LLVM
AllowShortIfStatementsOnASingleLine: false
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: false
IndentCaseLabels: true
ColumnLimit: 120
ObjCSpaceAfterProperty: true
KeepEmptyLinesAtTheStartOfBlocks: true
PenaltyBreakString: 1000000
SpacesInContainerLiterals: false