Skip to content

Instantly share code, notes, and snippets.

@ronen-fr
Created August 11, 2024 16:33
Show Gist options
  • Save ronen-fr/29157c6eb7a4f70f467949d59a1baab7 to your computer and use it in GitHub Desktop.
Save ronen-fr/29157c6eb7a4f70f467949d59a1baab7 to your computer and use it in GitHub Desktop.
clang format file as of 11 Aug 24
---
Language: Cpp
BasedOnStyle: Google
AlignAfterOpenBracket: AlwaysBreak
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
#AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllArgumentsOnNextLine: true
#AllowAllParametersOfDeclarationOnNextLine: true
BinPackArguments: true
ColumnLimit: 80
MaxEmptyLinesToKeep: 2
EmptyLineBeforeAccessModifier: Leave
Cpp11BracedListStyle: true
BinPackParameters: false
BreakBeforeBraces: Custom
BraceWrapping:
SplitEmptyFunction: false
AfterCaseLabel: false
AfterClass: false
AfterStruct: false
AfterFunction: true
AfterControlStatement: Never
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
DerivePointerAlignment: true
IndentWrappedFunctionNames: false
PointerAlignment: Left
AlwaysBreakTemplateDeclarations: Yes
BreakConstructorInitializers: BeforeComma
KeepEmptyLinesAtTheStartOfBlocks: true
ContinuationIndentWidth: 4
TabWidth: 8
#UseTab: Never
UseTab: Always
Standard: c++20
FixNamespaceComments: true
AllowAllParametersOfDeclarationOnNextLine: false
LambdaBodyIndentation: Signature
PackConstructorInitializers: CurrentLine
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
PenaltyBreakComment: 0
SeparateDefinitionBlocks: Leave
ReflowComments: false
SortIncludes: true
IncludeBlocks: Regroup
IncludeCategories:
- Regex: 'debug.h'
Priority: 4
- Regex: '\"\./[^/]+\"'
Priority: 1
- Regex: '\"[^/]+\"'
Priority: 8
- Regex: 'boost'
Priority: 5
- Regex: '<.*\.h'
Priority: 2
- Regex: '<'
Priority: 3
- Regex: '.*'
Priority: 6
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment