Last active
March 20, 2022 15:00
-
-
Save guilhermgonzaga/50feab05b9a8d3a105ef18019fe158cc to your computer and use it in GitHub Desktop.
Simple, reasonable, and flexible Clang-Format configuration for C/C++ code. To be extended...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BasedOnStyle: Chromium | |
--- | |
Language: Cpp | |
AccessModifierOffset: -2 # Negative of TabWidth | |
AlignConsecutiveAssignments: false | |
AlignConsecutiveBitFields: true | |
AlignConsecutiveDeclarations: false | |
AllowShortBlocksOnASingleLine: Empty | |
AllowShortFunctionsOnASingleLine: Empty | |
BinPackArguments: true | |
BinPackParameters: true | |
BreakBeforeBraces: Custom # Like Stroustrup, but does not break after function | |
BraceWrapping: | |
AfterFunction: false | |
BeforeCatch: true | |
BeforeElse: true | |
ColumnLimit: 85 | |
ConstructorInitializerAllOnOneLineOrOnePerLine: false | |
ContinuationIndentWidth: 2 # Same as TabWidth | |
DerivePointerAlignment: true | |
IndentCaseLabels: false | |
IndentGotoLabels: false | |
IndentWidth: 2 # Same as TabWidth | |
MaxEmptyLinesToKeep: 2 | |
PenaltyBreakComment: 35 | |
PenaltyExcessCharacter: 5 | |
PointerAlignment: Right | |
ReferenceAlignment: Left | |
ReflowComments: true | |
SortIncludes: Never | |
SpaceAfterCStyleCast: true | |
SpaceAfterTemplateKeyword: false | |
TabWidth: 2 # Update AccessModifierOffset, ContinuationIndentWidth, IndentWidth | |
UseTab: AlignWithSpaces |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment