Skip to content

Commit 770c07f

Browse files
authored
Better formatting
1 parent 89822e3 commit 770c07f

36 files changed

+670
-766
lines changed

.clang-format

Lines changed: 50 additions & 235 deletions
Original file line numberDiff line numberDiff line change
@@ -1,264 +1,79 @@
1-
## -------------------------------------------------------------------------------------------------
1+
##==================================================================================================
22
## SPY - C++ Informations Broker
33
## Copyright: SPY Project Contributors
44
## SPDX-License-Identifier: BSL-1.0
5-
## -------------------------------------------------------------------------------------------------
6-
BasedOnStyle: Microsoft
7-
AccessModifierOffset: -2
8-
AlignAfterOpenBracket: Align
9-
AlignArrayOfStructures: None
5+
##==================================================================================================
106
AlignConsecutiveAssignments:
11-
AcrossEmptyLines: false
12-
AcrossComments: false
13-
AlignCompound: false
7+
Enabled: true
8+
AcrossEmptyLines: true
9+
AcrossComments: true
10+
AlignCompound: true
1411
AlignFunctionPointers: false
1512
PadOperators: true
16-
AlignConsecutiveBitFields:
17-
Enabled: false
18-
AcrossEmptyLines: false
19-
AcrossComments: false
20-
AlignCompound: false
21-
AlignFunctionPointers: false
22-
PadOperators: false
2313
AlignConsecutiveDeclarations:
24-
Enabled: false
25-
AcrossEmptyLines: false
26-
AcrossComments: false
27-
AlignCompound: false
28-
AlignFunctionPointers: false
29-
PadOperators: false
30-
AlignConsecutiveMacros:
31-
Enabled: false
32-
AcrossEmptyLines: false
33-
AcrossComments: false
34-
AlignCompound: false
35-
AlignFunctionPointers: false
36-
PadOperators: false
37-
AlignConsecutiveShortCaseStatements:
38-
Enabled: false
39-
AcrossEmptyLines: false
40-
AcrossComments: false
41-
AlignCaseArrows: false
42-
AlignCaseColons: false
43-
AlignConsecutiveTableGenBreakingDAGArgColons:
44-
Enabled: false
45-
AcrossEmptyLines: false
46-
AcrossComments: false
47-
AlignCompound: false
48-
AlignFunctionPointers: false
49-
PadOperators: false
50-
AlignConsecutiveTableGenCondOperatorColons:
51-
Enabled: false
52-
AcrossEmptyLines: false
53-
AcrossComments: false
54-
AlignCompound: false
55-
AlignFunctionPointers: false
56-
PadOperators: false
57-
AlignConsecutiveTableGenDefinitionColons:
58-
Enabled: false
59-
AcrossEmptyLines: false
60-
AcrossComments: false
61-
AlignCompound: false
14+
Enabled: true
15+
AcrossEmptyLines: true
16+
AcrossComments: true
17+
AlignCompound: true
6218
AlignFunctionPointers: false
63-
PadOperators: false
19+
PadOperators: true
6420
AlignEscapedNewlines: Right
65-
AlignOperands: Align
66-
AlignTrailingComments:
67-
Kind: Always
68-
OverEmptyLines: 0
69-
AllowAllArgumentsOnNextLine: false
70-
AllowAllParametersOfDeclarationOnNextLine: true
71-
AllowBreakBeforeNoexceptSpecifier: Always
21+
AlignTrailingComments: true
22+
AlignAfterOpenBracket: Align
7223
AllowShortBlocksOnASingleLine: Always
73-
AllowShortCaseExpressionOnASingleLine: true
74-
AllowShortCaseLabelsOnASingleLine: false
75-
AllowShortCompoundRequirementOnASingleLine: true
76-
AllowShortEnumsOnASingleLine: false
77-
AllowShortFunctionsOnASingleLine: Inline
24+
AllowShortCaseLabelsOnASingleLine: true
25+
AllowShortFunctionsOnASingleLine: All
7826
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
79-
AllowShortLambdasOnASingleLine: All
8027
AllowShortLoopsOnASingleLine: true
81-
AlwaysBreakAfterDefinitionReturnType: None
82-
AlwaysBreakBeforeMultilineStrings: false
83-
AttributeMacros:
84-
- __capability
85-
BinPackArguments: true
86-
BinPackParameters: false
87-
BitFieldColonSpacing: Both
88-
BraceWrapping:
89-
AfterCaseLabel: false
90-
AfterClass: true
91-
AfterControlStatement: Always
92-
AfterEnum: true
93-
AfterFunction: true
94-
AfterNamespace: true
95-
AfterObjCDeclaration: true
96-
AfterStruct: true
97-
AfterUnion: false
98-
AfterExternBlock: true
99-
BeforeCatch: true
100-
BeforeElse: true
101-
BeforeLambdaBody: false
102-
BeforeWhile: false
103-
IndentBraces: false
104-
SplitEmptyFunction: true
105-
SplitEmptyRecord: true
106-
SplitEmptyNamespace: true
107-
BreakAdjacentStringLiterals: true
108-
BreakAfterAttributes: Leave
109-
BreakAfterJavaFieldAnnotations: false
110-
BreakAfterReturnType: None
111-
BreakArrays: false
112-
BreakBeforeBinaryOperators: None
113-
BreakBeforeBraces: Custom
114-
BreakBeforeConceptDeclarations: Always
115-
BreakBeforeInlineASMColon: OnlyMultiline
28+
AlwaysBreakTemplateDeclarations: MultiLine
29+
BreakBeforeBraces: Allman
11630
BreakBeforeTernaryOperators: true
117-
BreakConstructorInitializers: BeforeColon
118-
BreakFunctionDefinitionParameters: false
119-
BreakInheritanceList: BeforeColon
120-
BreakStringLiterals: true
121-
BreakTemplateDeclarations: MultiLine
122-
ColumnLimit: 120
123-
CommentPragmas: ""
124-
CompactNamespaces: false
125-
ConstructorInitializerIndentWidth: 2
126-
ContinuationIndentWidth: 2
31+
BreakConstructorInitializers: BeforeComma
32+
BreakInheritanceList: BeforeComma
33+
ColumnLimit: 100
12734
Cpp11BracedListStyle: true
128-
DerivePointerAlignment: false
129-
DisableFormat: false
130-
EmptyLineAfterAccessModifier: Never
131-
EmptyLineBeforeAccessModifier: LogicalBlock
132-
ExperimentalAutoDetectBinPacking: false
13335
FixNamespaceComments: false
13436
IncludeBlocks: Regroup
135-
IncludeCategories:
136-
- Regex: <spy/detail.hpp>
137-
Priority: 1
138-
CaseSensitive: true
139-
SortPriority: 1
140-
- Regex: <spy/.*>
141-
Priority: 2
142-
CaseSensitive: true
143-
SortPriority: 2
144-
- Regex: .*
145-
Priority: 3
146-
CaseSensitive: true
147-
SortPriority: 3
148-
IncludeIsMainRegex: ""
149-
IncludeIsMainSourceRegex: ""
150-
IndentAccessModifiers: false
151-
IndentCaseBlocks: false
15237
IndentCaseLabels: false
153-
IndentExternBlock: AfterExternBlock
154-
IndentGotoLabels: true
15538
IndentPPDirectives: None
156-
IndentRequiresClause: false
15739
IndentWidth: 2
158-
IndentWrappedFunctionNames: false
159-
InsertBraces: false
160-
InsertNewlineAtEOF: true
161-
InsertTrailingCommas: None
162-
IntegerLiteralSeparator:
163-
Binary: 0
164-
BinaryMinDigits: 0
165-
Decimal: 0
166-
DecimalMinDigits: 0
167-
Hex: 0
168-
HexMinDigits: 0
169-
JavaScriptQuotes: Leave
170-
JavaScriptWrapImports: true
171-
KeepEmptyLines:
172-
AtEndOfFile: false
173-
AtStartOfBlock: true
174-
AtStartOfFile: true
175-
LambdaBodyIndentation: Signature
176-
LineEnding: LF
177-
MacroBlockBegin: ""
178-
MacroBlockEnd: ""
179-
MainIncludeChar: AngleBracket
40+
KeepEmptyLinesAtTheStartOfBlocks: false
18041
MaxEmptyLinesToKeep: 1
18142
NamespaceIndentation: All
182-
ObjCBinPackProtocolList: Auto
183-
ObjCBlockIndentWidth: 2
184-
ObjCBreakBeforeNestedBlockParam: true
185-
ObjCSpaceAfterProperty: false
186-
ObjCSpaceBeforeProtocolList: true
187-
PPIndentWidth: -1
188-
PackConstructorInitializers: BinPack
189-
PenaltyBreakAssignment: 2
190-
PenaltyBreakBeforeFirstCallParameter: 19
191-
PenaltyBreakComment: 300
192-
PenaltyBreakFirstLessLess: 120
193-
PenaltyBreakOpenParenthesis: 0
194-
PenaltyBreakScopeResolution: 500
195-
PenaltyBreakString: 1000
196-
PenaltyBreakTemplateDeclaration: 10
197-
PenaltyExcessCharacter: 1000000
198-
PenaltyIndentedWhitespace: 0
199-
PenaltyReturnTypeOnItsOwnLine: 1000
20043
PointerAlignment: Left
201-
QualifierAlignment: Custom
202-
ReferenceAlignment: Pointer
203-
ReflowComments: true
204-
RemoveBracesLLVM: false
205-
RemoveParentheses: ReturnStatement
206-
RemoveSemicolon: false
207-
RequiresClausePosition: OwnLine
208-
RequiresExpressionIndentation: OuterScope
209-
SeparateDefinitionBlocks: Always
210-
ShortNamespaceLines: 1
211-
SkipMacroDefinitionBody: false
212-
SortIncludes: CaseSensitive
213-
SortJavaStaticImport: Before
214-
SortUsingDeclarations: LexicographicNumeric
215-
SpaceAfterCStyleCast: false
216-
SpaceAfterLogicalNot: false
44+
SortIncludes: Never
45+
SortUsingDeclarations: true
21746
SpaceAfterTemplateKeyword: false
218-
SpaceAroundPointerQualifiers: Default
21947
SpaceBeforeAssignmentOperators: true
220-
SpaceBeforeCaseColon: false
221-
SpaceBeforeCpp11BracedList: false
48+
SpaceBeforeCpp11BracedList: true
22249
SpaceBeforeCtorInitializerColon: true
22350
SpaceBeforeInheritanceColon: true
224-
SpaceBeforeJsonColon: false
225-
SpaceBeforeParens: ControlStatements
226-
SpaceBeforeParensOptions:
227-
AfterControlStatements: true
228-
AfterForeachMacros: true
229-
AfterFunctionDeclarationName: false
230-
AfterFunctionDefinitionName: false
231-
AfterIfMacros: true
232-
AfterOverloadedOperator: false
233-
AfterPlacementOperator: true
234-
AfterRequiresInClause: false
235-
AfterRequiresInExpression: false
236-
BeforeNonEmptyParentheses: false
237-
SpaceBeforeRangeBasedForLoopColon: true
238-
SpaceBeforeSquareBrackets: false
239-
SpaceInEmptyBlock: false
240-
SpacesBeforeTrailingComments: 1
241-
SpacesInAngles: Never
51+
SpaceBeforeParens: Never
52+
SpaceBeforeRangeBasedForLoopColon: false
53+
SpaceInEmptyParentheses: false
54+
SpacesInAngles: false
24255
SpacesInContainerLiterals: true
243-
SpacesInLineCommentPrefix:
244-
Minimum: 1
245-
Maximum: -1
246-
SpacesInParens: Never
247-
SpacesInParensOptions:
248-
ExceptDoubleParentheses: false
249-
InConditionalStatements: false
250-
InCStyleCasts: false
251-
InEmptyParentheses: false
252-
Other: false
253-
SpacesInSquareBrackets: false
254-
Standard: c++20
255-
TabWidth: 2
256-
TableGenBreakInsideDAGArg: DontBreak
56+
SpacesInCStyleCastParentheses: false
57+
SpacesInParentheses: false
58+
SpacesInSquareBrackets: true
59+
Standard: Cpp11
25760
UseTab: Never
258-
VerilogBreakBetweenInstancePorts: true
61+
BinPackArguments: false
62+
BinPackParameters: false
63+
ExperimentalAutoDetectBinPacking: false
64+
AllowAllParametersOfDeclarationOnNextLine: false
65+
QualifierAlignment: Right
66+
ReferenceAlignment: Pointer
67+
AlignArrayOfStructures: Right
68+
AlignConsecutiveMacros:
69+
Enabled: true
70+
AcrossEmptyLines: true
71+
AcrossComments: true
72+
AlignCompound: true
73+
PadOperators: true
74+
AllowShortCaseExpressionOnASingleLine: true
75+
AllowShortEnumsOnASingleLine: true
76+
AllowShortLambdasOnASingleLine: All
77+
BreakBeforeConceptDeclarations: Always
78+
InsertNewlineAtEOF: true
25979
Language: Cpp
260-
QualifierOrder:
261-
- inline
262-
- static
263-
- type
264-
- const

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ SPY turns compile-time detection into simple boolean checks:
2525
int main()
2626
{
2727
// Check Compiler
28-
if constexpr( spy::compiler == spy::clang_ )
28+
if constexpr( spy::compiler == spy::clang_ )
2929
{
3030
std::cout << "Optimizing with Clang version " << spy::compiler.version << "\n";
3131
}
3232

3333
// Check Architecture
34-
if constexpr( spy::architecture == spy::amd64_ )
34+
if constexpr( spy::architecture == spy::amd64_ )
3535
{
3636
std::cout << "Running on x86-64\n";
3737
}
3838

3939
// Check SIMD capabilities (hierarchical)
40-
if constexpr( spy::simd_instruction_set >= spy::avx2_ )
40+
if constexpr( spy::simd_instruction_set >= spy::avx2_ )
4141
{
4242
std::cout << "AVX2 or better is available\n";
4343
}

0 commit comments

Comments
 (0)