.clang-format 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. # Available style options are described in https://clang.llvm.org/docs/ClangFormatStyleOptions.html
  2. #
  3. # An easy way to create the .clang-format file is:
  4. #
  5. # clang-format -style=llvm -dump-config > .clang-format
  6. #
  7. ---
  8. Language: Cpp
  9. BasedOnStyle: LLVM
  10. AccessModifierOffset: -1
  11. AlignAfterOpenBracket: Align
  12. AlignArrayOfStructures: Right
  13. AlignConsecutiveAssignments:
  14. Enabled: true
  15. AcrossEmptyLines: false
  16. AcrossComments: false
  17. AlignCompound: true
  18. PadOperators: true
  19. AlignConsecutiveBitFields:
  20. Enabled: true
  21. AcrossEmptyLines: false
  22. AcrossComments: false
  23. AlignCompound: true
  24. PadOperators: true
  25. AlignConsecutiveDeclarations:
  26. Enabled: true
  27. AcrossEmptyLines: false
  28. AcrossComments: false
  29. AlignCompound: false
  30. PadOperators: false
  31. AlignConsecutiveMacros:
  32. Enabled: true
  33. AcrossEmptyLines: false
  34. AcrossComments: false
  35. AlignCompound: false
  36. PadOperators: false
  37. AlignConsecutiveShortCaseStatements:
  38. Enabled: false
  39. AcrossEmptyLines: false
  40. AcrossComments: false
  41. AlignCaseColons: false
  42. AlignEscapedNewlines: Left
  43. AlignOperands: Align
  44. AlignTrailingComments:
  45. Kind: Always
  46. OverEmptyLines: 1
  47. AllowAllArgumentsOnNextLine: false
  48. AllowAllParametersOfDeclarationOnNextLine: false
  49. AllowShortBlocksOnASingleLine: Always
  50. AllowShortCaseLabelsOnASingleLine: false
  51. AllowShortEnumsOnASingleLine: false
  52. AllowShortFunctionsOnASingleLine: None
  53. AllowShortIfStatementsOnASingleLine: WithoutElse
  54. AllowShortLambdasOnASingleLine: All
  55. AllowShortLoopsOnASingleLine: true
  56. AlwaysBreakAfterDefinitionReturnType: None
  57. AlwaysBreakAfterReturnType: None
  58. AlwaysBreakBeforeMultilineStrings: false
  59. AlwaysBreakTemplateDeclarations: MultiLine
  60. AttributeMacros:
  61. - __capability
  62. BinPackArguments: true
  63. BinPackParameters: true
  64. BitFieldColonSpacing: Both
  65. BraceWrapping:
  66. AfterCaseLabel: false
  67. AfterClass: true
  68. AfterControlStatement: Always
  69. AfterEnum: true
  70. AfterExternBlock: false
  71. AfterFunction: true
  72. AfterNamespace: true
  73. AfterObjCDeclaration: true
  74. AfterStruct: true
  75. AfterUnion: false
  76. BeforeCatch: true
  77. BeforeElse: true
  78. BeforeLambdaBody: false
  79. BeforeWhile: false
  80. IndentBraces: false
  81. SplitEmptyFunction: true
  82. SplitEmptyRecord: true
  83. SplitEmptyNamespace: true
  84. BreakAfterAttributes: Never
  85. BreakAfterJavaFieldAnnotations: false
  86. BreakArrays: false
  87. BreakBeforeBinaryOperators: NonAssignment
  88. BreakBeforeConceptDeclarations: Always
  89. BreakBeforeBraces: Custom
  90. BreakBeforeInlineASMColon: OnlyMultiline
  91. BreakBeforeTernaryOperators: true
  92. BreakConstructorInitializers: AfterColon
  93. BreakInheritanceList: AfterColon
  94. BreakStringLiterals: true
  95. ColumnLimit: 0
  96. CommentPragmas: "^ IWYU pragma:"
  97. CompactNamespaces: false
  98. ConstructorInitializerIndentWidth: 4
  99. ContinuationIndentWidth: 4
  100. Cpp11BracedListStyle: true
  101. DerivePointerAlignment: false
  102. DisableFormat: false
  103. EmptyLineAfterAccessModifier: Never
  104. EmptyLineBeforeAccessModifier: Always
  105. ExperimentalAutoDetectBinPacking: false
  106. FixNamespaceComments: true
  107. ForEachMacros:
  108. - foreach
  109. - Q_FOREACH
  110. - BOOST_FOREACH
  111. IfMacros:
  112. - KJ_IF_MAYBE
  113. IncludeBlocks: Preserve
  114. IncludeCategories:
  115. - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
  116. Priority: 2
  117. SortPriority: 0
  118. CaseSensitive: false
  119. - Regex: '^(<|"(gtest|gmock|isl|json)/)'
  120. Priority: 3
  121. SortPriority: 0
  122. CaseSensitive: false
  123. - Regex: ".*"
  124. Priority: 1
  125. SortPriority: 0
  126. CaseSensitive: false
  127. IncludeIsMainRegex: "(Test)?$"
  128. IncludeIsMainSourceRegex: ""
  129. IndentAccessModifiers: false
  130. IndentCaseBlocks: false
  131. IndentCaseLabels: false
  132. IndentExternBlock: NoIndent
  133. IndentGotoLabels: true
  134. IndentPPDirectives: None
  135. IndentRequiresClause: true
  136. IndentWidth: 4
  137. IndentWrappedFunctionNames: false
  138. InsertBraces: false
  139. InsertNewlineAtEOF: true
  140. InsertTrailingCommas: None
  141. IntegerLiteralSeparator:
  142. Binary: 0
  143. BinaryMinDigits: 0
  144. Decimal: 0
  145. DecimalMinDigits: 0
  146. Hex: 0
  147. HexMinDigits: 0
  148. JavaScriptQuotes: Leave
  149. JavaScriptWrapImports: true
  150. KeepEmptyLinesAtTheStartOfBlocks: false
  151. KeepEmptyLinesAtEOF: true
  152. LambdaBodyIndentation: Signature
  153. LineEnding: DeriveLF
  154. MacroBlockBegin: ""
  155. MacroBlockEnd: ""
  156. MaxEmptyLinesToKeep: 2
  157. NamespaceIndentation: None
  158. ObjCBinPackProtocolList: Auto
  159. ObjCBlockIndentWidth: 2
  160. ObjCBreakBeforeNestedBlockParam: true
  161. ObjCSpaceAfterProperty: false
  162. ObjCSpaceBeforeProtocolList: true
  163. PackConstructorInitializers: BinPack
  164. PenaltyBreakAssignment: 1000
  165. PenaltyBreakBeforeFirstCallParameter: 19
  166. PenaltyBreakComment: 300
  167. PenaltyBreakFirstLessLess: 120
  168. PenaltyBreakOpenParenthesis: 0
  169. PenaltyBreakString: 1000
  170. PenaltyBreakTemplateDeclaration: 10
  171. PenaltyExcessCharacter: 1000000
  172. PenaltyIndentedWhitespace: 0
  173. PenaltyReturnTypeOnItsOwnLine: 1000
  174. PointerAlignment: Right
  175. PPIndentWidth: 4
  176. QualifierAlignment: Leave
  177. ReferenceAlignment: Pointer
  178. ReflowComments: false
  179. RemoveBracesLLVM: false
  180. RemoveParentheses: Leave
  181. RemoveSemicolon: false
  182. RequiresClausePosition: OwnLine
  183. RequiresExpressionIndentation: OuterScope
  184. SeparateDefinitionBlocks: Leave
  185. ShortNamespaceLines: 1
  186. SortIncludes: Never
  187. SortJavaStaticImport: Before
  188. SortUsingDeclarations: LexicographicNumeric
  189. SpaceAfterCStyleCast: false
  190. SpaceAfterLogicalNot: false
  191. SpaceAfterTemplateKeyword: true
  192. SpaceAroundPointerQualifiers: Both
  193. SpaceBeforeAssignmentOperators: true
  194. SpaceBeforeCaseColon: false
  195. SpaceBeforeCpp11BracedList: false
  196. SpaceBeforeCtorInitializerColon: true
  197. SpaceBeforeInheritanceColon: true
  198. SpaceBeforeJsonColon: false
  199. SpaceBeforeParens: ControlStatements
  200. SpaceBeforeParensOptions:
  201. AfterControlStatements: true
  202. AfterForeachMacros: true
  203. AfterFunctionDefinitionName: false
  204. AfterFunctionDeclarationName: false
  205. AfterIfMacros: true
  206. AfterOverloadedOperator: false
  207. AfterRequiresInClause: false
  208. AfterRequiresInExpression: false
  209. BeforeNonEmptyParentheses: false
  210. SpaceBeforeRangeBasedForLoopColon: true
  211. SpaceBeforeSquareBrackets: false
  212. SpaceInEmptyBlock: false
  213. SpacesBeforeTrailingComments: 1
  214. SpacesInAngles: Never
  215. SpacesInContainerLiterals: true
  216. SpacesInLineCommentPrefix:
  217. Minimum: 1
  218. Maximum: -1
  219. SpacesInParens: Never
  220. SpacesInParensOptions:
  221. InCStyleCasts: false
  222. InConditionalStatements: false
  223. InEmptyParentheses: false
  224. Other: false
  225. SpacesInSquareBrackets: false
  226. Standard: Latest
  227. StatementAttributeLikeMacros:
  228. - Q_EMIT
  229. StatementMacros:
  230. - Q_UNUSED
  231. - QT_REQUIRE_VERSION
  232. TabWidth: 4
  233. UseTab: Never
  234. VerilogBreakBetweenInstancePorts: true
  235. WhitespaceSensitiveMacros:
  236. - BOOST_PP_STRINGIZE
  237. - CF_SWIFT_NAME
  238. - NS_SWIFT_NAME
  239. - PP_STRINGIZE
  240. - STRINGIZE
  241. ---