-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clang-format
More file actions
137 lines (123 loc) · 4.32 KB
/
Copy path.clang-format
File metadata and controls
137 lines (123 loc) · 4.32 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# .clang-format for Game Development & OOP Projects
# -------------------------------------------------
# Optimized for readability, consistency, and OOP best practices
Language: Cpp
Standard: c++17
BasedOnStyle: LLVM
# Basic Indentation and Layout
IndentWidth: 4
TabWidth: 4
UseTab: Never
ColumnLimit: 100
AccessModifierOffset: -4
IndentCaseLabels: true
IndentPPDirectives: AfterHash
NamespaceIndentation: None
IndentWrappedFunctionNames: false
MaxEmptyLinesToKeep: 1
KeepEmptyLinesAtTheStartOfBlocks: false
# Function Declarations and Definitions
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
AllowShortFunctionsOnASingleLine: Inline
BinPackArguments: false
BinPackParameters: false
# Braces & Wrapping Style (Allman-style for clear visual blocks)
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterStruct: true
AfterUnion: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterExternBlock: true
AfterControlStatement: true
BeforeElse: true
BeforeCatch: true
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
# Control Flow Statements
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
# Alignment Options for Readability
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignConsecutiveMacros: true
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
# Constructor Formatting
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
# Spacing
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
# Line Breaking
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakStringLiterals: true
# Pointers and References
PointerAlignment: Left
ReferenceAlignment: Left
# Comments
ReflowComments: true
CommentPragmas: '^ IWYU pragma:'
FixNamespaceComments: true
# Includes Organization
IncludeBlocks: Regroup
SortIncludes: true
IncludeCategories:
- Regex: '^<(Windows\.h|windows\.h)>'
Priority: 1
- Regex: '^<(GL\/|GLFW\/|SDL|sfml|vulkan|DirectX|dx|d3d)'
Priority: 2
- Regex: '^<(glm|bullet|physx|box2d)'
Priority: 3
- Regex: '^<(json|yaml|xml|rapidjson)'
Priority: 4
- Regex: '^<.*\.h>'
Priority: 5
- Regex: '^<.*>'
Priority: 6
- Regex: '^"(Engine|Core|Physics|Rendering|Audio|Input)/'
Priority: 7
- Regex: '^"(Components|Systems|Entities)/'
Priority: 8
- Regex: '^"(Game|Levels|UI)/'
Priority: 9
- Regex: '^".*"'
Priority: 10
# Other Settings
DerivePointerAlignment: false
SortUsingDeclarations: true
# Penalties
PenaltyBreakAssignment: 10
PenaltyBreakBeforeFirstCallParameter: 30
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 10
PenaltyExcessCharacter: 10
PenaltyReturnTypeOnItsOwnLine: 200