-
Notifications
You must be signed in to change notification settings - Fork 298
Expand file tree
/
Copy path.clang-format
More file actions
64 lines (52 loc) · 2.03 KB
/
.clang-format
File metadata and controls
64 lines (52 loc) · 2.03 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
---
# Based on the Google C++ Style Guide, with user-specific overrides.
BasedOnStyle: Google
# --- User Overrides from Uncrustify Config ---
# 1. Indentation
# Google Style default is 2, but we keep the explicit setting just in case.
# Uncrustify: indent_columns=2
IndentWidth: 2
# 2. Tabs
# Google Style default is Never, but explicitly set here.
# Uncrustify: indent_with_tabs=0
UseTab: Never
# 3. Column Width
# Uncrustify: code_width=80
ColumnLimit: 80
# 4. Brace Wrapping
# The Google Style default is already to attach braces to the line end
# (e.g., `if (x) { ... }`).
# Uncrustify: nl_class_brace=remove, nl_fdef_brace=remove
# We keep the default: BreakBeforeBraces: Attach
# 5. Assignment Alignment
# This is a key deviation from the Google default, which is usually 'None'.
# Uncrustify: indent_align_assign=true
AlignConsecutiveAssignments: true
# 6. Function Parameter Packing (Google default is to pack)
# Uncrustify: nl_func_def_args=add (Suggests placing each arg on a new line)
BinPackArguments: false
BinPackParameters: false # Applies to declarations
# 7. Pointer Alignment
# Google Style prefers the star next to the type ('int* foo').
# Uncrustify: sp_before_ptr_star=add (e.g. 'int * a;')
# We stick to the Google default: PointerAlignment: Left (or None, which often results in Left).
PointerAlignment: Left
# 8. Namespace Indentation
# Google Style default is false, matching:
# Uncrustify: indent_namespace=false
IndentNamespace: false
# 9. Case Label Indentation
# Google Style default is to indent `case` labels.
# Uncrustify: indent_switch_case=2 (Suggests indenting case labels)
IndentCaseLabels: true
# 10. Operator Alignment
# Uncrustify: align_left_shift=true
AlignOperands: Align
# 11. Newlines/Block Handling
# Uncrustify: mod_full_brace_if=add, mod_full_brace_for=add, etc.
# These are generally handled by Google's requirement for braces, even for single statements.
AllowShortBlocksOnASingleLine: Never
AllowShortIfStatementsOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: Never
AllowShortFunctionsOnASingleLine: Empty
...