# Usage:
# Using clang-format to reformat a file:
# clang-format -i -style=Google <file>
BasedOnStyle: Google
ColumnLimit: 120
AccessModifierOffset: -4
SortIncludes: false
BreakBeforeBraces: Custom
# 大括号换行配置
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: false
# AfterEnum: false (紧凑模式,左大括号和enum同行, enum Color {...), AfterEnum: true (左大括号和enum换行).
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
SplitEmptyNamespace: true
# Align
AlignAfterOpenBracket: AlwaysBreak
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
AttributeMacros:
- __global__
- __aicore__
- __cube__
- __vector__
- __mix__
- __host__
- __aicpu__
- __simd_vf__
- __simt_vf__
- __gm__
- __ubuf__
- __kfc_workspace__
BinPackArguments: true
BreakBeforeTernaryOperators: false
SpacesBeforeTrailingComments: 1
# poniter aligment
DerivePointerAlignment: false
PointerAlignment: Left
# single line layout
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
# tab space
UseTab: Never
IndentWidth: 4
TabWidth: 4