.clang-format 1.1 KB
Newer Older
1
2
3
4
5
BasedOnStyle: LLVM # K&R / "attach" braces like the code now
IndentWidth: 4 # 4‑space indents everywhere
TabWidth: 4
UseTab: Never # never convert to tabs
ColumnLimit: 120
Muyang Li's avatar
Muyang Li committed
6
AccessModifierOffset: -4
7
BreakBeforeBraces: Attach # `void foo() {` — brace on same line
Muyang Li's avatar
Muyang Li committed
8
BraceWrapping:
9
  AfterNamespace: false # `namespace x {` on same line
Muyang Li's avatar
Muyang Li committed
10
  SplitEmptyFunction: false
11
  SplitEmptyRecord: false
Muyang Li's avatar
Muyang Li committed
12
  SplitEmptyNamespace: false
13
14
15
PointerAlignment: Right # `int *ptr`, `const Foo *bar`
ReferenceAlignment: Pointer # `int &ref` -> same rule as pointers
SortIncludes: false # keep the hand‑crafted include order
Muyang Li's avatar
Muyang Li committed
16
17
IncludeBlocks: Preserve
SortUsingDeclarations: false
18
IndentPPDirectives: None # keep `#pragma` / `#if` at column 0
Muyang Li's avatar
Muyang Li committed
19
AllowShortFunctionsOnASingleLine: Empty
20
21
22
23
24
25
AllowShortIfStatementsOnASingleLine: false
AllowShortBlocksOnASingleLine: false
BinPackParameters: false # one parameter per line (as written)
BinPackArguments: false
AlignAfterOpenBracket: Align # preserve the current hanging‑indent style
AlignConsecutiveAssignments: true
Muyang Li's avatar
Muyang Li committed
26
27
28
AlignConsecutiveDeclarations: false
SpaceAfterTemplateKeyword: false
BreakTemplateDeclarations: Yes