EFanZh’s Blog

EFanZh’s ClangFormat configuration

This is my ClangFormat configuration:

---
BasedOnStyle: Chromium
AccessModifierOffset: -4
AlignTrailingComments: false
AllowShortFunctionsOnASingleLine: None
BinPackArguments: false
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: false
ColumnLimit: 120
Cpp11BracedListStyle: false
IndentWidth: 4
IndentWrappedFunctionNames: true
NamespaceIndentation: All
PenaltyBreakBeforeFirstCallParameter: 800
PenaltyBreakComment: 100
PenaltyBreakFirstLessLess: 600
PenaltyBreakString: 500
PenaltyExcessCharacter: 200
PenaltyReturnTypeOnItsOwnLine: 1000
PointerAlignment: Right
SortIncludes: true
SpacesBeforeTrailingComments: 1
Standard: Cpp11
TabWidth: 4
...