-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clang-format
More file actions
31 lines (27 loc) · 1022 Bytes
/
Copy path.clang-format
File metadata and controls
31 lines (27 loc) · 1022 Bytes
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
# Style for the GB emulator. Based on LLVM with tweaks to match the existing
# hand-written layout: 2-space indent, attached braces, indented case labels,
# and one-liners (short functions / case bodies / ifs) preserved.
#
# Grid tables (e.g. cycles_base[] in cpu.c) are protected with
# `// clang-format off` / `// clang-format on` — no style preserves those.
---
Language: Cpp
BasedOnStyle: LLVM
IndentWidth: 2
TabWidth: 2
UseTab: Never
ColumnLimit: 100
PointerAlignment: Right
IndentCaseLabels: true
# Keep the compact one-liners this codebase favors.
AllowShortFunctionsOnASingleLine: All
AllowShortCaseLabelsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AllowShortBlocksOnASingleLine: Empty
# Preserve the deliberate column alignment in headers/structs.
AlignConsecutiveMacros: AcrossComments
AlignConsecutiveDeclarations: AcrossComments
AlignTrailingComments: true
# `#include "gb.h"` must stay first; don't reorder include groups.
SortIncludes: false