-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.clang-format
45 lines (40 loc) · 3.17 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
# -*- yaml -*-
# This file determines clang-format's style settings; for details, refer to
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
BasedOnStyle: Google
# going against google style here on space before brace
# due to poor readability and wide adoption of the other style
# in textbooks and visual studio community
# https://google.github.io/styleguide/cppguide.html#Braced_Initializer_List_Format
SpaceBeforeCpp11BracedList: true
# PointerAlignment: Left # this is the default
DerivePointerAlignment: false
# line breaks should occur before both binary and ternary operators
# BreakBeforeTernaryOperators: true # this is the default
BreakBeforeBinaryOperators: NonAssignment
# Specify the #include statement order. This implements the order mandated by
# the Google C++ Style Guide:
# Related header, C system headers, C++ standard library headers,
# other libraries' headers, your project's headers.
#
# To obtain updated lists of system headers used in the below expressions, see:
# http://stackoverflow.com/questions/2027991/list-of-standard-header-files-in-c-and-c/2029106#2029106.
IncludeCategories:
# C standard library 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
# ROS C system library headers
- Regex: '^<(ros|cv_bridge|diagnostic_msgs|lcm/lcm_coretypes|nav_msgs|std_msgs|std_srvs|robot_msgs)[^\.]*(.h)?>$'
Priority: 2
# other C system library headers
- Regex: '^<(python3.*\/|drake|Eigen|fmt|gflags|gtest|ompl|openssl|zlib|yaml-cpp|cnpy|pybind11|torch|test\/cpp)[^\.]*(.h)?>$'
Priority: 3
# C++ STL system headers (with angles, 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: 4
# other C++ system library headers
- Regex: '^<.*>$'
Priority: 5
# Other (your project's) C++ libraries' h files (with quotes).
- Regex: '^".*"$'
Priority: 6