-
Notifications
You must be signed in to change notification settings - Fork 5
/
.clang-format
78 lines (63 loc) · 3.97 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
71
72
73
74
75
76
77
78
BasedOnStyle: Google
IndentWidth: 4
# public, private, protected are 4 spaces to the left of a class indent
AccessModifierOffset: -4
ColumnLimit: 100
# Always break before braces.
BreakBeforeBraces: Allman
# If false, the function's arguments will be on different lines if they don't
# fit on one line.
BinPackArguments: false
# If false, a function declaration’s or function definition’s parameters
# will either all be on the same line or will have one line each.
BinPackParameters: false
# Use at your own risk (diabled).
ExperimentalAutoDetectBinPacking: false
# Allow putting all parameters of a function declaration onto the next
# line even if BinPackParameters is false.
AllowAllParametersOfDeclarationOnNextLine: false
# If true, horizontally aligns arguments after an open bracket.
# This applies to round brackets (parentheses), angle brackets and square
# brackets.
AlignAfterOpenBracket: AlwaysBreak
# If true, horizontally align operands of binary and ternary expressions.
AlignOperands: true
# If a function call or braced initializer list doesn’t fit on a
# line, allow putting all arguments onto the next line, even if
# BinPackArguments is false.
AllowAllArgumentsOnNextLine: false
# If a constructor definition with a member initializer list doesn’t
# fit on a single line, allow putting all member initializers onto
# the next line, if `ConstructorInitializerAllOnOneLineOrOnePerLine`
# is true. Note that this parameter has no effect if
# `ConstructorInitializerAllOnOneLineOrOnePerLine` is false.
AllowAllConstructorInitializersOnNextLine: false
# Force break after template declaration only when the following
# declaration spans multiple lines.
AlwaysBreakTemplateDeclarations: Yes
# Break after return type automatically. PenaltyReturnTypeOnItsOwnLine is taken into account.
AlwaysBreakAfterReturnType: None
PenaltyReturnTypeOnItsOwnLine: 1000000
# Specify the #include statement order. This implements the order mandated by
# the Google C++ Style Guide: related header, C headers, C++ headers, library
# headers, and finally the project headers.
IncludeCategories:
# C system headers.
- Regex: '^[<"](aio|arpa/inet|assert|complex|cpio|ctype|curses|dirent|dlfcn|errno|fcntl|fenv|float|fmtmsg|fnmatch|ftw|glob|grp|iconv|inttypes|iso646|langinfo|libgen|limits|locale|math|monetary|mqueue|ndbm|netdb|net/if|netinet/in|netinet/tcp|nl_types|poll|pthread|pwd|regex|sched|search|semaphore|setjmp|signal|spawn|stdalign|stdarg|stdatomic|stdbool|stddef|stdint|stdio|stdlib|stdnoreturn|string|strings|stropts|sys/ipc|syslog|sys/mman|sys/msg|sys/resource|sys/select|sys/sem|sys/shm|sys/socket|sys/stat|sys/statvfs|sys/time|sys/times|sys/types|sys/uio|sys/un|sys/utsname|sys/wait|tar|term|termios|tgmath|threads|time|trace|uchar|ulimit|uncntrl|unistd|utime|utmpx|wchar|wctype|wordexp)\.h[">]$'
Priority: 1
# C++ system headers (as of C++17).
- Regex: '^[<"](algorithm|any|array|atomic|bitset|cassert|ccomplex|cctype|cerrno|cfenv|cfloat|charconv|chrono|cinttypes|ciso646|climits|clocale|cmath|codecvt|complex|condition_variable|csetjmp|csignal|cstdalign|cstdarg|cstdbool|cstddef|cstdint|cstdio|cstdlib|cstring|ctgmath|ctime|cuchar|cwchar|cwctype|deque|exception|execution|filesystem|forward_list|fstream|functional|future|initializer_list|iomanip|ios|iosfwd|iostream|istream|iterator|limits|list|locale|map|memory|memory_resource|mutex|new|numeric|optional|ostream|queue|random|ratio|regex|scoped_allocator|set|shared_mutex|sstream|stack|stdexcept|streambuf|string|string_view|strstream|system_error|thread|tuple|type_traits|typeindex|typeinfo|unordered_map|unordered_set|utility|valarray|variant|vector)[">]$'
Priority: 2
# Other libraries' h files (with angles).
- Regex: '^<'
Priority: 3
# Taproot libraries
- Regex: '^[<"]tap'
Priority: 4
# This forces full include paths above folder-specific includes.
# (i.e. "aruwsrc/control/foo.hpp" is above just "bar.hpp")
- Regex: '/+'
Priority: 5
# Other libraries' h files (with quotes).
- Regex: '^"'
Priority: 6