-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.clang-format
66 lines (56 loc) · 1.6 KB
/
.clang-format
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
# You may refer to the style options from the official site:
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
---
# The important stuff:
BasedOnStyle: Google
UseTab: Never
IndentWidth: 4
TabWidth: 4
ColumnLimit: 120
BreakBeforeBraces: Linux
# The not-so-important stuff:
AlignConsecutiveAssignments: Consecutive
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
BreakBeforeBinaryOperators: NonAssignment
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
DerivePointerAlignment: false
PointerAlignment: Left
IndentPPDirectives: None
MaxEmptyLinesToKeep: 2
ReflowComments: true
SpacesBeforeTrailingComments: 1
IncludeCategories:
# Standard headers.
- Regex: '<.+>'
Priority: 4
# STM Library headers.
- Regex: '^"(stm|system_stm|cmsis|core|mpu|FreeRTOS).*'
Priority: 3
# User Library headers.
- Regex: '^"(etl/|fmt/|magic_enum).*'
Priority: 2
# Other headers.
- Regex: '.*'
Priority: 1
# C++ Specifics:
AccessModifierOffset: -4
AllowShortLambdasOnASingleLine: All
BreakConstructorInitializers: BeforeComma
FixNamespaceComments: true
NamespaceIndentation: All
Standard: c++20
## C++20 (requires ClangFormat v12+):
BreakBeforeConceptDeclarations: true
IndentRequires: true
...