-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.clang-format
59 lines (51 loc) · 1.48 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
Language: Cpp
BasedOnStyle: Google
IndentWidth: 2
TabWidth: 2
UseTab: Never
AllowShortFunctionsOnASingleLine: Empty # Only allow short empty functions
IndentCaseLabels: false
AlwaysBreakTemplateDeclarations: Yes
SpaceBeforeParens: ControlStatements
SpacesInParentheses: false
SpacesInAngles: false
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: true
AllowAllParametersOfDeclarationOnNextLine: false
MaxEmptyLinesToKeep: 1
InsertNewlineAtEOF: true
SortIncludes: Never
IncludeBlocks: Regroup
IncludeCategories:
# Standard C headers in <.h>
- Regex: '<[-\w\/-_]+\.h>'
Priority: 1
# Standard C++ headers in <>
- Regex: '<[-\w\/-_]+>'
Priority: 2
# Specific external headers in <> to put first
- Regex: '<(catch2|gtest|doctest).*>'
Priority: 3
# External headers in <> with extension or /
- Regex: '<[-\w\/-_]+[\.\/][-\w\/-_]+>'
Priority: 4
# Local headers in ""
- Regex: '"[-\w\/-_]*"'
Priority: 5
# This part comes from
# https://github.com/ament/ament_lint/blob/humble/ament_clang_format/ament_clang_format/configuration/.clang-format
AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
BraceWrapping:
AfterClass: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
BreakBeforeBraces: Custom
ColumnLimit: 100
ConstructorInitializerIndentWidth: 0
ContinuationIndentWidth: 2
DerivePointerAlignment: false
# PointerAlignment: Middle
PointerAlignment: Left # Dr.QP, Middle is ugly
ReflowComments: false