---
Language: Cpp
Standard: c++20

# The following is close to the style we've been using all these years
# without formalizing it.  Formatting won't be enforced, but this file
# can help if you want to use the general feel of the library.

# General appearance:

BasedOnStyle: LLVM

IndentWidth: 4
ColumnLimit: 120
NamespaceIndentation: All
MaxEmptyLinesToKeep: 2
FixNamespaceComments: true
DerivePointerAlignment: false
PointerAlignment: Left

# Function declarations:
AllowShortFunctionsOnASingleLine: Empty
AlwaysBreakTemplateDeclarations: true

# Heads or tails:
SortIncludes: true
IncludeBlocks: Merge
IncludeCategories:
    - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
      Priority: 1
    - Regex: '^(<|"(gtest|gmock|isl|json)/)'
      Priority: 2
    # C system headers.  The header_dependency_test.py contains a copy of this
    # list; be sure to update that test anytime this list changes.
    - 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: 2
    # C++ system headers (as of C++23).  The header_dependency_test.py contains a
    # copy of this list; be sure to update that test anytime this list changes.
    - Regex: '^[<"](algorithm|any|array|atomic|barrier|bit|bitset|cassert|ccomplex|cctype|cerrno|cfenv|cfloat|charconv|chrono|cinttypes|ciso646|climits|clocale|cmath|codecvt|compare|complex|concepts|condition_variable|coroutine|csetjmp|csignal|cstdalign|cstdarg|cstdbool|cstddef|cstdint|cstdio|cstdlib|cstring|ctgmath|ctime|cuchar|cwchar|cwctype|deque|exception|execution|expected|filesystem|flat_map|flat_set|format|forward_list|fstream|functional|future|generator|initializer_list|iomanip|ios|iosfwd|iostream|istream|iterator|latch|limits|list|locale|map|mdspan|memory|memory_resource|mutex|new|numbers|numeric|optional|ostream|print|queue|random|ranges|ratio|regex|scoped_allocator|semaphore|set|shared_mutex|source_location|span|spanstream|sstream|stack|stacktrace|stdexcept|stdfloat|stop_token|streambuf|string|string_view|strstream|syncstream|system_error|thread|tuple|type_traits|typeindex|typeinfo|unordered_map|unordered_set|utility|valarray|variant|vector|version)[">]$'
      Priority: 3
    - Regex: "^<"
      Priority: 4
    - Regex: ".*"
      Priority: 5

# Other:
AlignConsecutiveAssignments: true
AlignEscapedNewlines: Left
AlignTrailingComments: true
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: false
ConstructorInitializerIndentWidth: 0
IndentCaseLabels: true
IndentPPDirectives: AfterHash
SortUsingDeclarations: false
