Skip to content

Commit 1fea13b

Browse files
committed
Copy .clang-format from alpaka
1 parent 29d2757 commit 1fea13b

File tree

1 file changed

+83
-27
lines changed

1 file changed

+83
-27
lines changed

.clang-format

+83-27
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ Standard: c++20
44
DisableFormat: false
55
AccessModifierOffset: -4
66
AlignAfterOpenBracket: AlwaysBreak
7+
AlignArrayOfStructures: None
78
AlignConsecutiveAssignments: false
89
AlignConsecutiveBitFields: false
910
AlignConsecutiveDeclarations: false
1011
AlignConsecutiveMacros: false
1112
AlignEscapedNewlines: Right
12-
AlignOperands: DontAlign
13-
AlignTrailingComments: false
13+
AlignOperands: Align
14+
AlignTrailingComments:
15+
Kind: Never
1416
AllowAllArgumentsOnNextLine: false
15-
AllowAllConstructorInitializersOnNextLine: false
1617
AllowAllParametersOfDeclarationOnNextLine: false
1718
AllowShortBlocksOnASingleLine: Never
1819
AllowShortCaseLabelsOnASingleLine: false
@@ -26,84 +27,139 @@ AlwaysBreakBeforeMultilineStrings: false
2627
AlwaysBreakTemplateDeclarations: Yes
2728
BinPackArguments: false
2829
BinPackParameters: false
30+
BitFieldColonSpacing: Both
31+
BreakAfterAttributes: Never
2932
BreakBeforeBinaryOperators: All
3033
BreakBeforeBraces: Allman
34+
BreakBeforeConceptDeclarations: Always
35+
BreakBeforeInlineASMColon: OnlyMultiline
3136
BreakBeforeTernaryOperators: true
3237
BreakConstructorInitializers: BeforeComma
3338
BreakInheritanceList: BeforeComma
3439
BreakStringLiterals: true
3540
ColumnLimit: 119
36-
CommentPragmas: "^ COMMENT pragma:"
41+
CommentPragmas: '^ COMMENT pragma:'
3742
CompactNamespaces: false
38-
ConstructorInitializerAllOnOneLineOrOnePerLine: true
3943
ConstructorInitializerIndentWidth: 4
4044
ContinuationIndentWidth: 4
4145
Cpp11BracedListStyle: true
42-
DeriveLineEnding: true
4346
DerivePointerAlignment: false
47+
EmptyLineAfterAccessModifier: Never
48+
EmptyLineBeforeAccessModifier: Always
4449
ExperimentalAutoDetectBinPacking: false
4550
FixNamespaceComments: true
4651
IncludeBlocks: Regroup
47-
IncludeIsMainRegex: "(Test)?$"
48-
IncludeIsMainSourceRegex: ""
52+
IncludeIsMainRegex: '(Test)?$'
53+
IncludeIsMainSourceRegex: ''
54+
IndentAccessModifiers: false
4955
IndentCaseBlocks: true
5056
IndentCaseLabels: false
5157
IndentExternBlock: AfterExternBlock
5258
IndentGotoLabels: true
5359
IndentPPDirectives: AfterHash
60+
IndentRequiresClause: false
5461
IndentWidth: 4
5562
IndentWrappedFunctionNames: false
63+
InsertBraces: false
64+
InsertNewlineAtEOF: true
65+
IntegerLiteralSeparator:
66+
Binary: 4
67+
Decimal: 3
68+
DecimalMinDigits: 7
69+
Hex: 4
5670
KeepEmptyLinesAtTheStartOfBlocks: false
57-
MacroBlockBegin: ""
58-
MacroBlockEnd: ""
71+
LambdaBodyIndentation: Signature
72+
LineEnding: DeriveLF
73+
MacroBlockBegin: ''
74+
MacroBlockEnd: ''
5975
MaxEmptyLinesToKeep: 2
6076
NamespaceIndentation: All
77+
PackConstructorInitializers: CurrentLine
6178
PenaltyBreakAssignment: 2
6279
PenaltyBreakBeforeFirstCallParameter: 19
6380
PenaltyBreakComment: 300
6481
PenaltyBreakFirstLessLess: 120
82+
PenaltyBreakOpenParenthesis: 0 # default made explicit here
6583
PenaltyBreakString: 1000
6684
PenaltyBreakTemplateDeclaration: 10
6785
PenaltyExcessCharacter: 1000000
86+
PenaltyIndentedWhitespace: 0 # default made explicit here
6887
PenaltyReturnTypeOnItsOwnLine: 1000
6988
PointerAlignment: Left
89+
PPIndentWidth: -1 # follow IndentWidth
90+
QualifierAlignment: Custom
91+
QualifierOrder: ['friend', 'static', 'inline', 'constexpr', 'type', 'const', 'volatile', 'restrict']
92+
ReferenceAlignment: Pointer # follow PointerAlignment
7093
ReflowComments: true
94+
RemoveBracesLLVM: false
95+
RemoveSemicolon: false
96+
RequiresClausePosition: WithPreceding
97+
RequiresExpressionIndentation: OuterScope
98+
ShortNamespaceLines: 0
7199
SortIncludes: true
72-
SortUsingDeclarations: true
100+
SortUsingDeclarations: Lexicographic
101+
SeparateDefinitionBlocks: Always
73102
SpaceAfterCStyleCast: true
74103
SpaceAfterLogicalNot: false
75104
SpaceAfterTemplateKeyword: false
105+
SpaceAroundPointerQualifiers: Default # follow PointerAlignment
76106
SpaceBeforeAssignmentOperators: true
107+
SpaceBeforeCaseColon: false
77108
SpaceBeforeCpp11BracedList: false
78109
SpaceBeforeCtorInitializerColon: true
79110
SpaceBeforeInheritanceColon: true
80111
SpaceBeforeParens: Never
81112
SpaceBeforeRangeBasedForLoopColon: true
113+
SpaceBeforeSquareBrackets: false
82114
SpaceInEmptyBlock: false
83115
SpaceInEmptyParentheses: false
84116
SpacesBeforeTrailingComments: 1
85117
SpacesInAngles: false
86118
SpacesInConditionalStatement: false
87119
SpacesInContainerLiterals: false
88120
SpacesInCStyleCastParentheses: false
121+
SpacesInLineCommentPrefix:
122+
Minimum: 1
123+
Maximum: -1
89124
SpacesInParentheses: false
90125
SpacesInSquareBrackets: false
91-
SpaceBeforeSquareBrackets: false
92126
TabWidth: 4
93127
UseCRLF: false
94128
UseTab: Never
95-
# Project specific options -- uncomment and modify as needed
96-
#IncludeCategories:
97-
# - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
98-
# Priority: 2
99-
# SortPriority: 0
100-
# - Regex: '^(<|"(gtest|gmock|isl|json)/)'
101-
# Priority: 3
102-
# SortPriority: 0
103-
# - Regex: '.*'
104-
# Priority: 1
105-
# SortPriority: 0
106-
107-
# Future options - not supported in clang-format 11
108-
# BitFieldColonSpacing: Both
109-
# OperandAlignmentStyle: Align
129+
# Project specific options
130+
#AttributeMacros: []
131+
#ForEachMacros: []
132+
#IfMacros: []
133+
IncludeCategories:
134+
# Local headers (in "") above all else
135+
- Regex: '"([A-Za-z0-9.\/-_])+"'
136+
Priority: 1
137+
# "alpaka/foo.hpp" after local headers (occur inside alpaka)
138+
- Regex: '"alpaka/([A-Za-z0-9.\/-_])+"'
139+
Priority: 2
140+
# <alpaka/foo.hpp> after local headers (occur outside alpaka in examples and test)
141+
- Regex: '<alpaka/([A-Za-z0-9.\/-_])+>'
142+
Priority: 3
143+
# C++ standard library headers are the last group to be included
144+
- Regex: '<([A-Za-z0-9\/-_])+>'
145+
Priority: 5
146+
# Includes that made it this far are third-party headers and will be placed
147+
# below alpaka's includes
148+
- Regex: '<([A-Za-z0-9.\/-_])+>'
149+
Priority: 4
150+
# Macros: []
151+
# NamespaceMacros: []
152+
StatementAttributeLikeMacros:
153+
- 'ALPAKA_DEVICE_VOLATILE'
154+
- 'ALPAKA_FN_ACC'
155+
- 'ALPAKA_FN_EXTERN'
156+
- 'ALPAKA_FN_HOST'
157+
- 'ALPAKA_FN_HOST_ACC'
158+
- 'ALPAKA_FN_INLINE'
159+
- 'ALPAKA_STATIC_ACC_MEM_CONSTANT'
160+
- 'ALPAKA_STATIC_ACC_MEM_GLOBAL'
161+
- 'ALPAKA_UNROLL'
162+
- 'ALPAKA_VECTORIZE_HINT'
163+
#StatementMacros: []
164+
#TypenameMacros: []
165+
#WhitespaceSensitiveMacros: []

0 commit comments

Comments
 (0)