.clang-format 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. ---
  2. Language: Cpp
  3. BasedOnStyle: Google
  4. AccessModifierOffset: -1
  5. AlignAfterOpenBracket: Align
  6. AlignConsecutiveAssignments: true
  7. AlignConsecutiveDeclarations: false
  8. AlignOperands: true
  9. AlignTrailingComments: true
  10. AllowAllParametersOfDeclarationOnNextLine: false
  11. AllowShortBlocksOnASingleLine: false
  12. AllowShortCaseLabelsOnASingleLine: false
  13. AllowShortFunctionsOnASingleLine: All
  14. AllowShortIfStatementsOnASingleLine: true
  15. AllowShortLoopsOnASingleLine: true
  16. AlwaysBreakAfterDefinitionReturnType: None
  17. AlwaysBreakAfterReturnType: None
  18. AlwaysBreakBeforeMultilineStrings: true
  19. AlwaysBreakTemplateDeclarations: true
  20. BinPackArguments: false
  21. BinPackParameters: false
  22. BraceWrapping:
  23. AfterClass: false
  24. AfterControlStatement: false
  25. AfterEnum: false
  26. AfterFunction: false
  27. AfterNamespace: false
  28. AfterObjCDeclaration: false
  29. AfterStruct: false
  30. AfterUnion: false
  31. BeforeCatch: false
  32. BeforeElse: false
  33. IndentBraces: false
  34. BreakBeforeBinaryOperators: None
  35. BreakBeforeBraces: Attach
  36. BreakBeforeTernaryOperators: true
  37. BreakConstructorInitializersBeforeComma: false
  38. CommentPragmas: "^ IWYU pragma:"
  39. ConstructorInitializerAllOnOneLineOrOnePerLine: true
  40. ConstructorInitializerIndentWidth: 4
  41. ContinuationIndentWidth: 4
  42. Cpp11BracedListStyle: true
  43. DerivePointerAlignment: true
  44. DisableFormat: false
  45. ExperimentalAutoDetectBinPacking: false
  46. ForEachMacros:
  47. - foreach
  48. - Q_FOREACH
  49. - BOOST_FOREACH
  50. IncludeCategories:
  51. # Spacers
  52. - Regex: "^<clang-format-priority-15>$"
  53. Priority: 15
  54. - Regex: "^<clang-format-priority-25>$"
  55. Priority: 25
  56. - Regex: "^<clang-format-priority-35>$"
  57. Priority: 35
  58. - Regex: "^<clang-format-priority-45>$"
  59. Priority: 45
  60. # C system headers
  61. - 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[">]$'
  62. Priority: 10
  63. # C++ system headers
  64. - 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)[">]$'
  65. Priority: 20
  66. # Other library h files (with angles)
  67. - Regex: "^<"
  68. Priority: 30
  69. # Your project's h files (with angles)
  70. - Regex: "^<MambaGlue"
  71. Priority: 40
  72. # Your project's h files
  73. - Regex: '^"MambaGlue'
  74. Priority: 50
  75. IndentCaseLabels: true
  76. IndentWidth: 2
  77. IndentWrappedFunctionNames: false
  78. KeepEmptyLinesAtTheStartOfBlocks: false
  79. MacroBlockBegin: ""
  80. MacroBlockEnd: ""
  81. ColumnLimit: 100
  82. MaxEmptyLinesToKeep: 1
  83. NamespaceIndentation: None
  84. ObjCBlockIndentWidth: 2
  85. ObjCSpaceAfterProperty: false
  86. ObjCSpaceBeforeProtocolList: false
  87. PenaltyBreakBeforeFirstCallParameter: 1
  88. PenaltyBreakComment: 300
  89. PenaltyBreakFirstLessLess: 120
  90. PenaltyBreakString: 1000
  91. PenaltyExcessCharacter: 1000000
  92. PenaltyReturnTypeOnItsOwnLine: 200
  93. PointerAlignment: Left
  94. ReflowComments: true
  95. SortIncludes: true
  96. SpaceAfterCStyleCast: false
  97. SpaceBeforeAssignmentOperators: true
  98. SpaceBeforeParens: ControlStatements
  99. SpaceInEmptyParentheses: false
  100. SpacesBeforeTrailingComments: 2
  101. SpacesInAngles: false
  102. SpacesInContainerLiterals: true
  103. SpacesInCStyleCastParentheses: false
  104. SpacesInParentheses: false
  105. SpacesInSquareBrackets: false
  106. Standard: Auto
  107. TabWidth: 4
  108. UseTab: Never