Skip to content

Instantly share code, notes, and snippets.

@socantre
Created October 1, 2014 18:50
Show Gist options
  • Save socantre/6aef721bd39c6af82008 to your computer and use it in GitHub Desktop.
Save socantre/6aef721bd39c6af82008 to your computer and use it in GitHub Desktop.
Clang format template
BasedOnStyle: LLVM # LLVM, Google, Chromium, Mozilla, WebKit
AccessModifierOffset: -4
AlignEscapedNewlinesLeft: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: false # None(false), Inline, All(true)
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackParameters: true
BreakBeforeBinaryOperators: NonAssignment # None, NonAssignment, All
BreakBeforeBraces: Attach # Attach, Linux, Stroustrup, Allman, GNU
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: true
ColumnLimit: 80
# CommentPragmas
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DisableFormat: false
ExperimentalAutoDetectBinPacking: true
# ForEachMacros
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
Language: Cpp # None, Cpp, JavaScript, Proto
MaxEmptyLinesToKeep: 1
NamespaceIndentation: Inner # None, Inner, All
# ObjCSpaceAfterProperty
# ObjCSpaceBeforeProtocolList
#// PenaltyBreakBeforeFirstCallParameter
#// PenaltyBreakComment
#// PenaltyBreakFirstLessLess
#// PenaltyBreakString
#// PenaltyExcessCharacter
#// PenaltyReturnTypeOnItsOwnLine:
PointerAlignment: Right # Left, Right, Middle
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements # Never, ControlStatements, Always
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11 # Cpp03, Cpp11, Auto
TabWidth: 4
UseTab: ForIndentation # Never(false), ForIndentation, Always(true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment