Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a66c124

Browse files
committed
Update .clang-format
1 parent 135e51e commit a66c124

File tree

2 files changed

+35
-12
lines changed

2 files changed

+35
-12
lines changed

.clang-format

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ SpaceAfterCStyleCast: false
111111
SpaceAfterLogicalNot: false
112112
SpaceAfterTemplateKeyword: true
113113
SpaceBeforeAssignmentOperators: true
114-
SpaceBeforeCpp11BracedList: false
114+
SpaceBeforeCpp11BracedList: true
115115
SpaceBeforeCtorInitializerColon: true
116116
SpaceBeforeInheritanceColon: true
117117
SpaceBeforeParens: ControlStatements
@@ -126,7 +126,7 @@ SpacesInCStyleCastParentheses: false
126126
SpacesInParentheses: false
127127
SpacesInSquareBrackets: false
128128
SpaceBeforeSquareBrackets: false
129-
Standard: 14
129+
Standard: c++14
130130
StatementMacros:
131131
- Q_UNUSED
132132
- QT_REQUIRE_VERSION

examples/.clang-format

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,29 @@ Language: Cpp
33
# BasedOnStyle: LLVM
44
AccessModifierOffset: -1
55
AlignAfterOpenBracket: Align
6+
AlignConsecutiveMacros: false
67
AlignConsecutiveAssignments: false
78
AlignConsecutiveDeclarations: false
89
AlignEscapedNewlines: Right
910
AlignOperands: true
1011
AlignTrailingComments: true
12+
AllowAllArgumentsOnNextLine: true
13+
AllowAllConstructorInitializersOnNextLine: true
1114
AllowAllParametersOfDeclarationOnNextLine: true
12-
AllowShortBlocksOnASingleLine: false
15+
AllowShortBlocksOnASingleLine: Never
1316
AllowShortCaseLabelsOnASingleLine: true
1417
AllowShortFunctionsOnASingleLine: Inline
15-
AllowShortIfStatementsOnASingleLine: false
18+
AllowShortLambdasOnASingleLine: All
19+
AllowShortIfStatementsOnASingleLine: Never
1620
AllowShortLoopsOnASingleLine: false
1721
AlwaysBreakAfterDefinitionReturnType: None
1822
AlwaysBreakAfterReturnType: None
1923
AlwaysBreakBeforeMultilineStrings: false
24+
AlwaysBreakTemplateDeclarations: true
2025
BinPackArguments: true
2126
BinPackParameters: true
22-
BraceWrapping:
27+
BraceWrapping:
28+
AfterCaseLabel: false
2329
AfterClass: false
2430
AfterControlStatement: false
2531
AfterEnum: false
@@ -38,6 +44,7 @@ BraceWrapping:
3844
BreakBeforeBinaryOperators: None
3945
BreakBeforeBraces: Attach
4046
BreakBeforeInheritanceComma: false
47+
BreakInheritanceList: BeforeColon
4148
BreakBeforeTernaryOperators: true
4249
BreakConstructorInitializersBeforeComma: false
4350
BreakConstructorInitializers: BeforeColon
@@ -50,24 +57,30 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: false
5057
ConstructorInitializerIndentWidth: 2
5158
ContinuationIndentWidth: 2
5259
Cpp11BracedListStyle: true
60+
DeriveLineEnding: true
5361
DerivePointerAlignment: false
5462
DisableFormat: false
5563
ExperimentalAutoDetectBinPacking: false
5664
FixNamespaceComments: true
57-
ForEachMacros:
65+
ForEachMacros:
5866
- foreach
5967
- Q_FOREACH
6068
- BOOST_FOREACH
6169
IncludeBlocks: Preserve
62-
IncludeCategories:
70+
IncludeCategories:
6371
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
6472
Priority: 2
73+
SortPriority: 0
6574
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
6675
Priority: 3
76+
SortPriority: 0
6777
- Regex: '.*'
6878
Priority: 1
79+
SortPriority: 0
6980
IncludeIsMainRegex: '(Test)?$'
81+
IncludeIsMainSourceRegex: ''
7082
IndentCaseLabels: true
83+
IndentGotoLabels: true
7184
IndentPPDirectives: None
7285
IndentWidth: 2
7386
IndentWrappedFunctionNames: false
@@ -78,6 +91,7 @@ MacroBlockBegin: ''
7891
MacroBlockEnd: ''
7992
MaxEmptyLinesToKeep: 1
8093
NamespaceIndentation: None
94+
ObjCBinPackProtocolList: Auto
8195
ObjCBlockIndentWidth: 2
8296
ObjCSpaceAfterProperty: false
8397
ObjCSpaceBeforeProtocolList: true
@@ -86,28 +100,37 @@ PenaltyBreakBeforeFirstCallParameter: 19
86100
PenaltyBreakComment: 300
87101
PenaltyBreakFirstLessLess: 120
88102
PenaltyBreakString: 1000
103+
PenaltyBreakTemplateDeclaration: 10
89104
PenaltyExcessCharacter: 1000000
90-
AlwaysBreakTemplateDeclarations: true
91105
PenaltyReturnTypeOnItsOwnLine: 60
92106
PointerAlignment: Right
93-
RawStringFormats:
94-
- Language: TextProto
95-
- BasedOnStyle: google
96107
ReflowComments: false
97108
SortIncludes: true
98109
SortUsingDeclarations: true
99110
SpaceAfterCStyleCast: false
111+
SpaceAfterLogicalNot: false
100112
SpaceAfterTemplateKeyword: true
101113
SpaceBeforeAssignmentOperators: true
114+
SpaceBeforeCpp11BracedList: true
115+
SpaceBeforeCtorInitializerColon: true
116+
SpaceBeforeInheritanceColon: true
102117
SpaceBeforeParens: ControlStatements
118+
SpaceBeforeRangeBasedForLoopColon: true
119+
SpaceInEmptyBlock: false
103120
SpaceInEmptyParentheses: false
104121
SpacesBeforeTrailingComments: 1
105122
SpacesInAngles: false
123+
SpacesInConditionalStatement: false
106124
SpacesInContainerLiterals: true
107125
SpacesInCStyleCastParentheses: false
108126
SpacesInParentheses: false
109127
SpacesInSquareBrackets: false
110-
Standard: Cpp11
128+
SpaceBeforeSquareBrackets: false
129+
Standard: c++14
130+
StatementMacros:
131+
- Q_UNUSED
132+
- QT_REQUIRE_VERSION
111133
TabWidth: 8
134+
UseCRLF: false
112135
UseTab: Never
113136
...

0 commit comments

Comments
 (0)