Skip to content

Commit 1e5eb5f

Browse files
committed
Create .clang-format
1 parent 51cff6a commit 1e5eb5f

File tree

1 file changed

+122
-0
lines changed

1 file changed

+122
-0
lines changed

.clang-format

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
3+
Language: Cpp
4+
BasedOnStyle: Google
5+
AccessModifierOffset: -4
6+
AlignArrayOfStructures: Left
7+
AlignAfterOpenBracket: BlockIndent
8+
AlignConsecutiveAssignments:
9+
Enabled: true
10+
AcrossEmptyLines: true
11+
AcrossComments: false
12+
AlignConsecutiveDeclarations: true
13+
AlignEscapedNewlinesLeft: false
14+
AlignOperands: true
15+
AlignTrailingComments: true
16+
AllowShortLambdasOnASingleLine: true
17+
AllowAllParametersOfDeclarationOnNextLine: true
18+
AllowShortBlocksOnASingleLine: false
19+
AllowShortCaseLabelsOnASingleLine: false
20+
AllowShortFunctionsOnASingleLine: InlineOnly
21+
AllowShortIfStatementsOnASingleLine: false
22+
AllowShortLoopsOnASingleLine: false
23+
AlwaysBreakAfterDefinitionReturnType: None
24+
AlwaysBreakAfterReturnType: None
25+
AlwaysBreakBeforeMultilineStrings: false
26+
AlwaysBreakTemplateDeclarations: true
27+
BreakAfterAttributes: Always
28+
BinPackArguments: true
29+
BinPackParameters: false
30+
BreakBeforeBraces: Custom
31+
BraceWrapping:
32+
# AfterClass: true
33+
# AfterControlStatement: true
34+
# AfterEnum: true
35+
# AfterFunction: true
36+
# AfterNamespace: true
37+
# AfterObjCDeclaration: true
38+
# AfterStruct: true
39+
# AfterUnion: true
40+
# AfterCaseLabel: true
41+
# BeforeCatch: true
42+
# BeforeElse: true
43+
# BeforeLambdaBody: false
44+
# IndentBraces: false
45+
AfterClass: false
46+
AfterCaseLabel: false
47+
AfterControlStatement: false
48+
AfterEnum: false
49+
AfterExternBlock: false
50+
AfterFunction: false
51+
AfterNamespace: false
52+
AfterObjCDeclaration: false
53+
AfterStruct: false
54+
AfterUnion: false
55+
BeforeCatch: false
56+
BeforeElse: false
57+
BeforeLambdaBody: false
58+
BeforeWhile: false
59+
IndentBraces: false
60+
SplitEmptyFunction: false
61+
SplitEmptyRecord: false
62+
SplitEmptyNamespace: false
63+
BreakBeforeBinaryOperators: NonAssignment
64+
BreakBeforeTernaryOperators: true
65+
BreakConstructorInitializersBeforeComma: true
66+
BreakConstructorInitializers: BeforeComma
67+
ColumnLimit: 120
68+
CompactNamespaces: false
69+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
70+
ConstructorInitializerIndentWidth: 4
71+
ContinuationIndentWidth: 4
72+
Cpp11BracedListStyle: true
73+
SpaceBeforeCpp11BracedList: false
74+
# Concepts related settings:
75+
BreakBeforeConceptDeclarations: Always
76+
RequiresExpressionIndentation: OuterScope # requires clang-format 16
77+
SpaceBeforeParens: Custom
78+
SpaceBeforeParensOptions:
79+
AfterControlStatements: true
80+
AfterRequiresInClause: true
81+
AfterRequiresInExpression: true
82+
DerivePointerAlignment: false
83+
DisableFormat: false
84+
ExperimentalAutoDetectBinPacking: false
85+
FixNamespaceComments: true
86+
IndentCaseLabels: false
87+
IndentWidth: 4
88+
IndentWrappedFunctionNames: false
89+
IndentRequiresClause: true
90+
KeepEmptyLinesAtTheStartOfBlocks: false
91+
MacroBlockBegin: ""
92+
MacroBlockEnd: ""
93+
MaxEmptyLinesToKeep: 2
94+
NamespaceIndentation: None
95+
PenaltyBreakBeforeFirstCallParameter: 19
96+
PenaltyBreakComment: 300
97+
PenaltyBreakFirstLessLess: 120
98+
PenaltyBreakString: 1000
99+
PenaltyExcessCharacter: 1000000
100+
PenaltyReturnTypeOnItsOwnLine: 60
101+
PointerAlignment: Left
102+
QualifierAlignment: Custom
103+
QualifierOrder: ['static', 'friend', 'constexpr', 'inline', 'const', 'type', 'volatile']
104+
RemoveSemicolon: true
105+
ReflowComments: true
106+
SortIncludes: true
107+
SortUsingDeclarations: Lexicographic
108+
SpaceAfterCStyleCast: false
109+
SpaceAfterTemplateKeyword: true # "template<typename T>" instead of "template <typename T>"
110+
SpaceBeforeAssignmentOperators: true
111+
SpaceBeforeInheritanceColon: true
112+
# SpaceBeforeParens: ControlStatements
113+
SpaceInEmptyParentheses: false
114+
SpacesBeforeTrailingComments: 1
115+
SpacesInAngles: false
116+
SpacesInContainerLiterals: false
117+
SpacesInCStyleCastParentheses: false
118+
SpacesInParentheses: false
119+
SpacesInSquareBrackets: false
120+
Standard: Latest
121+
TabWidth: 4
122+
UseTab: Never

0 commit comments

Comments
 (0)