Skip to content

Commit 1f03e4d

Browse files
committedAug 27, 2023
update .clang-format to match PrusaSlicer's format
1 parent e6fcbfa commit 1f03e4d

File tree

1 file changed

+49
-95
lines changed

1 file changed

+49
-95
lines changed
 

‎.clang-format

+49-95
Original file line numberDiff line numberDiff line change
@@ -1,166 +1,120 @@
1-
---
1+
#
2+
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
3+
#
24
Language: Cpp
3-
# BasedOnStyle: LLVM
4-
AccessModifierOffset: -2
5+
AccessModifierOffset: -4
56
AlignAfterOpenBracket: Align
6-
AlignConsecutiveMacros: None
7-
AlignConsecutiveAssignments: None
8-
AlignConsecutiveBitFields: None
9-
AlignConsecutiveDeclarations: None
10-
AlignEscapedNewlines: Right
11-
AlignOperands: Align
7+
AlignConsecutiveAssignments: true
8+
AlignConsecutiveDeclarations: true
9+
AlignEscapedNewlines: DontAlign
10+
AlignOperands: true
1211
AlignTrailingComments: true
13-
AllowAllArgumentsOnNextLine: true
14-
AllowAllConstructorInitializersOnNextLine: true
1512
AllowAllParametersOfDeclarationOnNextLine: true
16-
AllowShortEnumsOnASingleLine: true
17-
AllowShortBlocksOnASingleLine: Never
18-
AllowShortCaseLabelsOnASingleLine: false
13+
AllowShortBlocksOnASingleLine: true
14+
AllowShortCaseLabelsOnASingleLine: true
1915
AllowShortFunctionsOnASingleLine: All
20-
AllowShortLambdasOnASingleLine: All
21-
AllowShortIfStatementsOnASingleLine: Never
16+
AllowShortIfStatementsOnASingleLine: false
2217
AllowShortLoopsOnASingleLine: false
2318
AlwaysBreakAfterDefinitionReturnType: None
2419
AlwaysBreakAfterReturnType: None
2520
AlwaysBreakBeforeMultilineStrings: false
26-
AlwaysBreakTemplateDeclarations: MultiLine
27-
AttributeMacros:
28-
- __capability
21+
AlwaysBreakTemplateDeclarations: false
2922
BinPackArguments: true
30-
BinPackParameters: true
31-
BraceWrapping:
32-
AfterCaseLabel: false
33-
AfterClass: false
34-
AfterControlStatement: Never
23+
BinPackParameters: false
24+
BraceWrapping:
25+
AfterClass: true
26+
AfterControlStatement: false
3527
AfterEnum: false
36-
AfterFunction: false
28+
AfterFunction: true
3729
AfterNamespace: false
3830
AfterObjCDeclaration: false
39-
AfterStruct: false
31+
AfterStruct: true
4032
AfterUnion: false
4133
AfterExternBlock: false
4234
BeforeCatch: false
4335
BeforeElse: false
44-
BeforeLambdaBody: false
45-
BeforeWhile: false
4636
IndentBraces: false
47-
SplitEmptyFunction: true
48-
SplitEmptyRecord: true
49-
SplitEmptyNamespace: true
37+
SplitEmptyFunction: false
38+
SplitEmptyRecord: false
39+
SplitEmptyNamespace: false
5040
BreakBeforeBinaryOperators: None
51-
BreakBeforeConceptDeclarations: true
52-
BreakBeforeBraces: Attach
41+
BreakBeforeBraces: Custom
5342
BreakBeforeInheritanceComma: false
5443
BreakInheritanceList: BeforeColon
55-
BreakBeforeTernaryOperators: true
44+
BreakBeforeTernaryOperators: false
5645
BreakConstructorInitializersBeforeComma: false
57-
BreakConstructorInitializers: BeforeColon
46+
BreakConstructorInitializers: BeforeComma
5847
BreakAfterJavaFieldAnnotations: false
5948
BreakStringLiterals: true
60-
ColumnLimit: 120
49+
ColumnLimit: 140
6150
CommentPragmas: '^ IWYU pragma:'
62-
CompactNamespaces: false
63-
ConstructorInitializerAllOnOneLineOrOnePerLine: false
51+
CompactNamespaces: true
52+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
6453
ConstructorInitializerIndentWidth: 4
6554
ContinuationIndentWidth: 4
6655
Cpp11BracedListStyle: true
67-
DeriveLineEnding: true
6856
DerivePointerAlignment: false
6957
DisableFormat: false
70-
EmptyLineBeforeAccessModifier: LogicalBlock
7158
ExperimentalAutoDetectBinPacking: false
7259
FixNamespaceComments: true
73-
ForEachMacros:
60+
ForEachMacros:
61+
- forever
7462
- foreach
7563
- Q_FOREACH
7664
- BOOST_FOREACH
77-
StatementAttributeLikeMacros:
78-
- Q_EMIT
7965
IncludeBlocks: Preserve
80-
IncludeCategories:
81-
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
82-
Priority: 2
83-
SortPriority: 0
84-
CaseSensitive: false
66+
IncludeCategories:
67+
- Regex: '^<Q.*'
68+
Priority: 200
8569
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
8670
Priority: 3
87-
SortPriority: 0
88-
CaseSensitive: false
8971
- Regex: '.*'
9072
Priority: 1
91-
SortPriority: 0
92-
CaseSensitive: false
9373
IncludeIsMainRegex: '(Test)?$'
94-
IncludeIsMainSourceRegex: ''
9574
IndentCaseLabels: false
96-
IndentCaseBlocks: false
97-
IndentGotoLabels: true
9875
IndentPPDirectives: None
99-
IndentExternBlock: AfterExternBlock
100-
IndentRequires: false
101-
IndentWidth: 2
76+
IndentWidth: 4
10277
IndentWrappedFunctionNames: false
103-
InsertTrailingCommas: None
10478
JavaScriptQuotes: Leave
10579
JavaScriptWrapImports: true
106-
KeepEmptyLinesAtTheStartOfBlocks: true
80+
#KeepLineBreaksForNonEmptyLines: false
81+
KeepEmptyLinesAtTheStartOfBlocks: false
10782
MacroBlockBegin: ''
10883
MacroBlockEnd: ''
10984
MaxEmptyLinesToKeep: 1
11085
NamespaceIndentation: None
11186
ObjCBinPackProtocolList: Auto
112-
ObjCBlockIndentWidth: 2
113-
ObjCBreakBeforeNestedBlockParam: true
87+
ObjCBlockIndentWidth: 4
11488
ObjCSpaceAfterProperty: false
11589
ObjCSpaceBeforeProtocolList: true
116-
PenaltyBreakAssignment: 2
117-
PenaltyBreakBeforeFirstCallParameter: 19
118-
PenaltyBreakComment: 300
119-
PenaltyBreakFirstLessLess: 120
120-
PenaltyBreakString: 1000
90+
PenaltyBreakAssignment: 150
91+
PenaltyBreakBeforeFirstCallParameter: 300
92+
PenaltyBreakComment: 500
93+
PenaltyBreakFirstLessLess: 400
94+
PenaltyBreakString: 600
12195
PenaltyBreakTemplateDeclaration: 10
122-
PenaltyExcessCharacter: 1000000
123-
PenaltyReturnTypeOnItsOwnLine: 60
124-
PenaltyIndentedWhitespace: 0
96+
PenaltyExcessCharacter: 50
97+
PenaltyReturnTypeOnItsOwnLine: 300
12598
PointerAlignment: Right
12699
ReflowComments: true
127-
SortIncludes: true
128-
SortJavaStaticImport: Before
129-
SortUsingDeclarations: true
130-
SpaceAfterCStyleCast: false
131-
SpaceAfterLogicalNot: false
132-
SpaceAfterTemplateKeyword: true
100+
SortIncludes: false
101+
SortUsingDeclarations: false
102+
SpaceAfterCStyleCast: true
103+
SpaceAfterTemplateKeyword: false
133104
SpaceBeforeAssignmentOperators: true
134-
SpaceBeforeCaseColon: false
135105
SpaceBeforeCpp11BracedList: false
136106
SpaceBeforeCtorInitializerColon: true
137107
SpaceBeforeInheritanceColon: true
138108
SpaceBeforeParens: ControlStatements
139-
SpaceAroundPointerQualifiers: Default
140109
SpaceBeforeRangeBasedForLoopColon: true
141-
SpaceInEmptyBlock: false
142110
SpaceInEmptyParentheses: false
143111
SpacesBeforeTrailingComments: 1
144112
SpacesInAngles: false
145-
SpacesInConditionalStatement: false
146-
SpacesInContainerLiterals: true
113+
SpacesInContainerLiterals: false
147114
SpacesInCStyleCastParentheses: false
148115
SpacesInParentheses: false
149116
SpacesInSquareBrackets: false
150-
SpaceBeforeSquareBrackets: false
151-
BitFieldColonSpacing: Both
152-
Standard: Latest
153-
StatementMacros:
154-
- Q_UNUSED
155-
- QT_REQUIRE_VERSION
117+
Standard: Cpp11
156118
TabWidth: 4
157-
UseCRLF: false
158119
UseTab: Never
159-
WhitespaceSensitiveMacros:
160-
- STRINGIZE
161-
- PP_STRINGIZE
162-
- BOOST_PP_STRINGIZE
163-
- NS_SWIFT_NAME
164-
- CF_SWIFT_NAME
165-
...
166120

0 commit comments

Comments
 (0)
Please sign in to comment.