Skip to content

Instantly share code, notes, and snippets.

@alepez
Created January 22, 2016 08:11
Show Gist options
  • Save alepez/7dc448200b65fd8ba67a to your computer and use it in GitHub Desktop.
Save alepez/7dc448200b65fd8ba67a to your computer and use it in GitHub Desktop.
my clang format
## http://clang.llvm.org/docs/ClangFormatStyleOptions.html
## Version: 3.8
---
BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: false
## AlwaysBreakAfterDefinitionReturnType DEPRECATED
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: false
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
ColumnLimit: 120
CommentPragmas: '^\ *format-off'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
## IncludeCategories: http://llvm.org/docs/CodingStandards.html#include-style
IndentCaseLabels: false
IndentFunctionDeclarationAfterType: false
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
Language: Cpp
## MacroBlockBegin:
## MacroBlockEnd:
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PenaltyBreakBeforeFirstCallParameter: 19
## PenaltyBreakComment: 300
## PenaltyBreakFirstLessLess: 120
## PenaltyBreakString: 1000
## PenaltyExcessCharacter: 1000000
## PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
PointerBindsToType: true
SpaceAfterCStyleCast: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 2
UseTab: ForIndentation
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment