-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Expand file tree
/
Copy path.clang-format
More file actions
96 lines (86 loc) · 2.28 KB
/
Copy path.clang-format
File metadata and controls
96 lines (86 loc) · 2.28 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
# QGroundControl C++ Code Formatting
# Based on Google style with QGC customizations
# Matches CodingStyle.cc/h patterns
BasedOnStyle: Google
Language: Cpp
# Line length and indentation
ColumnLimit: 120
IndentWidth: 4
TabWidth: 4
UseTab: Never
ContinuationIndentWidth: 4
AccessModifierOffset: -4
# Bracing - Custom QGC style
# Functions/Classes: New line (Allman)
# Control statements: Same line (K&R)
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: Never
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterStruct: true
AfterUnion: true
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
# Pointer and reference alignment
PointerAlignment: Left
ReferenceAlignment: Left
DerivePointerAlignment: false
# Spacing
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInAngles: Never
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
# Include sorting
SortIncludes: CaseSensitive
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<Q.*>' # Qt headers
Priority: 1
- Regex: '^<[a-z].*>' # System/STL headers
CaseSensitive: true
Priority: 2
- Regex: '.*' # Project headers
Priority: 3
# Alignment
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: None
AlignConsecutiveDeclarations: None
AlignOperands: Align
AlignTrailingComments:
Kind: Always
OverEmptyLines: 1
# Line breaks
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ConstructorInitializerIndentWidth: 4
# Namespace formatting
CompactNamespaces: false
NamespaceIndentation: None
# Other formatting
BinPackArguments: true
BinPackParameters: true
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
ReflowComments: true
SeparateDefinitionBlocks: Always
Standard: c++20