-
Notifications
You must be signed in to change notification settings - Fork 183
Expand file tree
/
Copy path.clang-format
More file actions
61 lines (50 loc) · 1.37 KB
/
.clang-format
File metadata and controls
61 lines (50 loc) · 1.37 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
---
# .clang-format — Code formatting for C11 codebase.
#
# Style: K&R braces, 4-space indent, 100-column limit.
# Equivalent to Go's gofmt for consistent formatting.
Language: Cpp
BasedOnStyle: LLVM
# Indentation
IndentWidth: 4
ContinuationIndentWidth: 4
TabWidth: 4
UseTab: Never
# Column limit
ColumnLimit: 100
# Braces: K&R style (same line)
BreakBeforeBraces: Attach
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowShortBlocksOnASingleLine: Empty
# Pointer alignment: right (matches our style: const char* name)
PointerAlignment: Right
DerivePointerAlignment: false
# Includes: keep grouped
IncludeBlocks: Preserve
SortIncludes: Never
# Switch/case
IndentCaseLabels: false
IndentCaseBlocks: false
# Spacing
SpaceAfterCStyleCast: false
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
# Alignment
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
# Penalties (prefer breaking after return type for long signatures)
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyReturnTypeOnItsOwnLine: 200
# Keep existing formatting for macro-heavy code
ForEachMacros:
- CBM_DYN_ARRAY_FOREACH
...