【发布时间】:2020-07-05 18:59:25
【问题描述】:
在这种情况下,我无法专门配置我的 clang 格式文件。这可能是一个愚蠢的问题,但我尝试了几种组合,但我无法设置它。
我有什么:
bool res = MethodName(<ParameterList>);
res = res && AdtVec_Equal(<ParameterList>);
res = res && AdtVec_Equal(<ParameterList>);
res = res &&
AdtVec_Equal(<ParameterList>); //same num of parameters, longer names
我想要什么:
bool res = MethodName(<ParameterList>);
res = res && AdtVec_Equal(<ParameterList>);
res = res && AdtVec_Equal(<ParameterList>);
res = res && AdtVec_Equal(<ParamA>, <ParamB>,
<ParamC>);
我认为这是由于 columnLimit 值而发生的,但我不想将其设置得更长。有什么想法吗?
我的 .clang 格式文件如下:
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignConsecutiveMacros: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
BeforeElse: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Stroustrup
BreakBeforeTernaryOperators: false
BreakInheritanceList: AfterColon
ColumnLimit: 80
ContinuationIndentWidth: 8
IncludeBlocks: Regroup
IndentCaseLabels: true
IndentWidth: 2
KeepEmptyLinesAtTheStartOfBlocks: false
PenaltyReturnTypeOnItsOwnLine: 100
PointerAlignment: Left
ReflowComments: false
SortIncludes: true
SpacesBeforeTrailingComments: 2
Standard: Auto
提前致谢。
【问题讨论】: