forked from ub-cavas/AutowareAuto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-format
70 lines (64 loc) · 2.16 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
67
68
69
70
# This file is provided for developer convenience.
# The recommended way to format Autoware.Auto code is as follows:
# (optional) ament_clang_format --config ../AutowareAuto/.clang-format --reformat foobar.cpp
# ament_uncrustify --reformat foobar.cpp
# ament_cpplint foobar.cpp
# Fix errors stated
# Repeat previous 4 steps until ament_uncrustify and ament_cpplint give no more errors.
# Modified from https://github.com/ament/ament_lint/blob/master/ament_clang_format/ament_clang_format/configuration/.clang-format
Language: Cpp
BasedOnStyle: Google
AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowShortFunctionsOnASingleLine: Inline
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortLambdasOnASingleLine: All
AlwaysBreakTemplateDeclarations: MultiLine
BraceWrapping:
AfterClass: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
BinPackArguments: false
BinPackParameters: false
BreakBeforeBraces: Custom
ColumnLimit: 100
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 0
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
DerivePointerAlignment: false
FixNamespaceComments: true
IncludeBlocks: Regroup
IncludeCategories:
# Main header (e.g. foo.hpp for foo.cpp) automatically assigned priority zero
# Rules are processed in order, the first match assigns the priority, so more general rules come last
# C System headers
- Regex: '^<.*\.h>'
Priority: 1
# Eigen headers are not std C++ headers
- Regex: '<Eigen/([A-Za-z0-9\Q/-_\E])+>'
Priority: 3
# Headers in <> without extension; e.g. C++ standard
- Regex: '<([A-Za-z0-9\Q/-_\E])+>'
Priority: 2
# Messages
- Regex: '.*_msgs/.*\.hpp'
Priority: 4
# Headers in "" with file extension; e.g. from the same or another package
- Regex: '"([A-Za-z0-9.\Q/-_\E])+"'
Priority: 3
# Other Packages
- Regex: '^<.*/.*\.h.*>'
Priority: 3
IndentPPDirectives: BeforeHash
IndentWidth: '2'
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
PointerAlignment: Middle
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
UseTab: Never