-
Notifications
You must be signed in to change notification settings - Fork 4
/
.clang-format
108 lines (108 loc) · 3.44 KB
/
.clang-format
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# requires clang-format version 13.0+
---
AlignAfterOpenBracket: Align
# Instead ContinuationIndentWidth is used
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
# Aligns \ symbols on the left; other options DontAlign, Left
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
# When declaring a function, parameters continue on the same line
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
# while (true) {} allowed
# if (a) return; is allowed
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: true
AfterControlStatement: MultiLine
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBraces: Custom
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: true
BreakInheritanceList: BeforeColon
BreakConstructorInitializers: BeforeColon
BreakStringLiterals: true
ColumnLimit: 100
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
DerivePointerAlignment: false
FixNamespaceComments: true
IncludeBlocks: Regroup
# Priority is:
# 1. Geant4 headers in ""
# 1. Geant4 headers in "" that don't start with 'G4'
# 2. External package headers with extension in "" or <> (but _should_ be <>)
# 3. System headers (not exhaustive)
# Note order of regexes is important as they are matched in order
IncludeCategories:
- Regex: '^"G4.*\.hh"'
Priority: 1
- Regex: '^"(Randomize|globals)\.hh"'
Priority: 1
- Regex: '^"[[:alnum:]\/\-_.]+"'
Priority: 2
- Regex: '^<[a-z_]+>'
Priority: 3
- Regex: '^<[[:alnum:]\/.]+>'
Priority: 2
# Provides an extra indent level for public/protected/private sections
# without requiring excess indention and use of AccessModifierOffset
IndentAccessModifiers: true
IndentCaseLabels: true
IndentPPDirectives: AfterHash
IndentWidth: 2
KeepEmptyLinesAtTheStartOfBlocks: false
Language: Cpp
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 2
UseTab: Never
...