Skip to content

Commit 77f9a5e

Browse files
committed
New formatting rules
1 parent 2fce131 commit 77f9a5e

12 files changed

+5954
-6136
lines changed

.clang-format

Lines changed: 31 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,38 @@
11
---
2-
Language: Cpp
3-
AccessModifierOffset: '-4'
4-
AlignAfterOpenBracket: Align
5-
AlignConsecutiveAssignments: 'false'
6-
AlignConsecutiveDeclarations: 'false'
7-
AlignEscapedNewlines: Left
8-
AlignOperands: 'true'
9-
AlignTrailingComments: 'false'
10-
AllowAllParametersOfDeclarationOnNextLine: 'false'
11-
AllowShortBlocksOnASingleLine: 'false'
12-
AllowShortCaseLabelsOnASingleLine: 'false'
2+
BasedOnStyle: LLVM
3+
AccessModifierOffset: -4
4+
AlignArrayOfStructures: Left
5+
AlignEscapedNewlines: DontAlign
6+
AlignTrailingComments:
7+
Kind: Never
8+
AllowShortEnumsOnASingleLine: false
139
AllowShortFunctionsOnASingleLine: None
14-
AllowShortIfStatementsOnASingleLine: 'false'
15-
AllowShortLoopsOnASingleLine: 'false'
16-
AlwaysBreakAfterReturnType: None
17-
AlwaysBreakBeforeMultilineStrings: 'false'
18-
AlwaysBreakTemplateDeclarations: 'Yes'
19-
BinPackArguments: 'false'
20-
BinPackParameters: 'false'
21-
BraceWrapping:
22-
AfterClass: true
23-
AfterControlStatement: true
24-
AfterEnum: true
25-
AfterFunction: true
26-
AfterNamespace: true
27-
AfterObjCDeclaration: false
28-
AfterStruct: true
29-
AfterUnion: true
30-
AfterExternBlock: true
31-
BeforeCatch: true
32-
BeforeElse: true
33-
IndentBraces: false
34-
SplitEmptyFunction: true
35-
SplitEmptyRecord: true
36-
SplitEmptyNamespace: true
37-
BreakAfterJavaFieldAnnotations: 'true'
10+
AlwaysBreakTemplateDeclarations: Yes
11+
BinPackArguments: false
12+
BinPackParameters: false
3813
BreakBeforeBinaryOperators: NonAssignment
39-
BreakBeforeBraces: Custom
40-
BreakBeforeTernaryOperators: 'true'
14+
BreakBeforeBraces: Allman
4115
BreakConstructorInitializers: BeforeComma
4216
BreakInheritanceList: BeforeComma
43-
BreakStringLiterals: 'false'
44-
ColumnLimit: '100'
45-
CompactNamespaces: 'false'
46-
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
47-
ConstructorInitializerIndentWidth: '2'
48-
ContinuationIndentWidth: '2'
49-
Cpp11BracedListStyle: 'true'
50-
DerivePointerAlignment: 'false'
51-
DisableFormat: 'false'
52-
ExperimentalAutoDetectBinPacking: 'false'
53-
FixNamespaceComments: 'true'
54-
ForEachMacros:
55-
- foreach
56-
- Q_FOREACH
57-
- BOOST_FOREACH
58-
IncludeBlocks: Preserve
59-
IndentCaseLabels: 'true'
17+
ColumnLimit: 120
18+
ContinuationIndentWidth: 2
19+
IndentCaseBlocks: true
20+
IndentCaseLabels: true
6021
IndentPPDirectives: AfterHash
61-
IndentWidth: '4'
62-
IndentWrappedFunctionNames: 'false'
63-
KeepEmptyLinesAtTheStartOfBlocks: 'true'
64-
MacroBlockBegin: ''
65-
MacroBlockEnd: ''
66-
MaxEmptyLinesToKeep: '1'
67-
NamespaceIndentation: None
68-
PenaltyBreakAssignment: 2
69-
PenaltyBreakBeforeFirstCallParameter: 19
70-
PenaltyBreakComment: 300
71-
PenaltyBreakFirstLessLess: 120
72-
PenaltyBreakString: 1000
73-
PenaltyBreakTemplateDeclaration: 10
74-
PenaltyExcessCharacter: 1000000
75-
PenaltyReturnTypeOnItsOwnLine: 1000000
22+
IndentWidth: 4
23+
InsertNewlineAtEOF: true
24+
NamespaceIndentation: All
25+
PackConstructorInitializers: CurrentLine
7626
PointerAlignment: Left
77-
ReflowComments: 'false'
78-
SortIncludes: 'false'
79-
SortUsingDeclarations: 'false'
80-
SpaceAfterCStyleCast: 'false'
81-
SpaceAfterTemplateKeyword: 'false'
82-
SpaceBeforeAssignmentOperators: 'true'
83-
SpaceBeforeCpp11BracedList: 'false'
84-
SpaceBeforeCtorInitializerColon: 'false'
85-
SpaceBeforeInheritanceColon: 'true'
86-
SpaceBeforeParens: Never
87-
SpaceBeforeRangeBasedForLoopColon: 'false'
88-
SpaceInEmptyParentheses: 'false'
89-
SpacesBeforeTrailingComments: '1'
90-
SpacesInAngles: 'false'
91-
SpacesInCStyleCastParentheses: 'false'
92-
SpacesInContainerLiterals: 'false'
93-
SpacesInParentheses: 'false'
94-
SpacesInSquareBrackets: 'false'
95-
Standard: Cpp11
96-
TabWidth: '4'
97-
UseTab: ForIndentation
98-
...
27+
#ReflowComments: false # for Doxygen
28+
SeparateDefinitionBlocks: Always
29+
ShortNamespaceLines: 0
30+
SpaceAfterTemplateKeyword: false
31+
SpaceBeforeParens: Custom
32+
SpaceBeforeParensOptions:
33+
AfterControlStatements: false
34+
AfterForeachMacros: false
35+
AfterIfMacros: false
36+
#AfterPlacementOperator: false
37+
SpaceBeforeRangeBasedForLoopColon: false
38+
TabWidth: 4

0 commit comments

Comments
 (0)