.clang-format 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # SPDX-License-Identifier: GPL-2.0
  2. #
  3. # clang-format configuration file. Intended for clang-format >= 4.
  4. #
  5. # For more information, see:
  6. #
  7. # Documentation/process/clang-format.rst
  8. # https://clang.llvm.org/docs/ClangFormat.html
  9. # https://clang.llvm.org/docs/ClangFormatStyleOptions.html
  10. #
  11. ---
  12. AccessModifierOffset: -4
  13. AlignAfterOpenBracket: AlwaysBreak
  14. AlignConsecutiveAssignments: false
  15. AlignConsecutiveDeclarations: false
  16. #AlignEscapedNewlines: Left # Unknown to clang-format-4.0
  17. AlignOperands: true
  18. AlignTrailingComments: true
  19. AllowAllParametersOfDeclarationOnNextLine: false
  20. AllowShortBlocksOnASingleLine: false
  21. AllowShortCaseLabelsOnASingleLine: false
  22. AllowShortFunctionsOnASingleLine: None
  23. AllowShortIfStatementsOnASingleLine: false
  24. AllowShortLoopsOnASingleLine: false
  25. AlwaysBreakAfterDefinitionReturnType: None
  26. AlwaysBreakAfterReturnType: None
  27. AlwaysBreakBeforeMultilineStrings: false
  28. AlwaysBreakTemplateDeclarations: false
  29. BinPackArguments: false
  30. BinPackParameters: false
  31. BraceWrapping:
  32. AfterClass: false
  33. AfterControlStatement: false
  34. AfterEnum: false
  35. AfterFunction: true
  36. AfterNamespace: true
  37. AfterObjCDeclaration: false
  38. AfterStruct: false
  39. AfterUnion: false
  40. #AfterExternBlock: false # Unknown to clang-format-5.0
  41. BeforeCatch: false
  42. BeforeElse: false
  43. IndentBraces: false
  44. #SplitEmptyFunction: true # Unknown to clang-format-4.0
  45. #SplitEmptyRecord: true # Unknown to clang-format-4.0
  46. #SplitEmptyNamespace: true # Unknown to clang-format-4.0
  47. BreakBeforeBinaryOperators: None
  48. BreakBeforeBraces: Custom
  49. #BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0
  50. BreakBeforeTernaryOperators: false
  51. BreakConstructorInitializersBeforeComma: false
  52. #BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0
  53. BreakAfterJavaFieldAnnotations: false
  54. BreakStringLiterals: false
  55. ColumnLimit: 120
  56. CommentPragmas: '^ IWYU pragma:'
  57. #CompactNamespaces: false # Unknown to clang-format-4.0
  58. ConstructorInitializerAllOnOneLineOrOnePerLine: false
  59. ConstructorInitializerIndentWidth: 4
  60. ContinuationIndentWidth: 4
  61. Cpp11BracedListStyle: true
  62. DerivePointerAlignment: false
  63. DisableFormat: false
  64. ExperimentalAutoDetectBinPacking: false
  65. #FixNamespaceComments: false # Unknown to clang-format-4.0
  66. #IncludeBlocks: Preserve # Unknown to clang-format-5.0
  67. IncludeCategories:
  68. - Regex: '.*'
  69. Priority: 1
  70. IncludeIsMainRegex: '(Test)?$'
  71. IndentCaseLabels: true
  72. #IndentPPDirectives: None # Unknown to clang-format-5.0
  73. IndentWidth: 4
  74. IndentWrappedFunctionNames: false
  75. JavaScriptQuotes: Leave
  76. JavaScriptWrapImports: true
  77. KeepEmptyLinesAtTheStartOfBlocks: false
  78. MacroBlockBegin: ''
  79. MacroBlockEnd: ''
  80. MaxEmptyLinesToKeep: 1
  81. NamespaceIndentation: Inner
  82. #ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0
  83. ObjCBlockIndentWidth: 4
  84. ObjCSpaceAfterProperty: true
  85. ObjCSpaceBeforeProtocolList: true
  86. # Taken from git's rules
  87. #PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0
  88. PenaltyBreakBeforeFirstCallParameter: 30
  89. PenaltyBreakComment: 10
  90. PenaltyBreakFirstLessLess: 0
  91. PenaltyBreakString: 10
  92. PenaltyExcessCharacter: 100
  93. PenaltyReturnTypeOnItsOwnLine: 60
  94. PointerAlignment: Right
  95. ReflowComments: false
  96. SortIncludes: false
  97. #SortUsingDeclarations: false # Unknown to clang-format-4.0
  98. SpaceAfterCStyleCast: false
  99. SpaceAfterTemplateKeyword: true
  100. SpaceBeforeAssignmentOperators: true
  101. #SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0
  102. #SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0
  103. SpaceBeforeParens: ControlStatements
  104. #SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0
  105. SpaceInEmptyParentheses: false
  106. SpacesBeforeTrailingComments: 1
  107. SpacesInAngles: false
  108. SpacesInContainerLiterals: false
  109. SpacesInCStyleCastParentheses: false
  110. SpacesInParentheses: false
  111. SpacesInSquareBrackets: false
  112. Standard: Cpp03
  113. TabWidth: 4
  114. UseTab: Never
  115. ...