在较新版本的clang-format
中,配置文件的格式稍有不同。以下是将旧版本的配置转换为新版本的写法:
---
BasedOnStyle: LLVM
ColumnLimit: 250
IndentWidth: 4
UseTab: Never
TabWidth: 4
AccessModifierOffset: -4
NamespaceIndentation: None
BreakBeforeBraces:
BraceWrapping.AfterFunction = true
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
AlignTrailingComments: true
ContinuationIndentWidth: 0
...
请注意,不同版本的clang-format
可能会有一些细微差别,在实际使用时,请参考适用于您所使用版本的文档和说明。
内容由零声教学AI助手提供,问题来源于学员提问