Advertisement
Falven

.clang-format

Apr 8th, 2015
1,146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 11.49 KB | None | 0 0
  1. #http://clang.llvm.org/docs/ClangFormatStyleOptions.html
  2.  
  3. # The style used for all options not specifically set in the configuration.
  4. # This option is supported only in the clang-format configuration (both within -style='{...}' and the .clang-format file).
  5. # LLVM A style complying with the LLVM coding standards
  6. # Google A style complying with Google’s C++ style guide
  7. # Chromium A style complying with Chromium’s style guide
  8. # Mozilla A style complying with Mozilla’s style guide
  9. # WebKit A style complying with WebKit’s style guide
  10. #BasedOnStyle: Webkit
  11.  
  12. # The extra indent or outdent of access modifiers, e.g. public:.
  13. AccessModifierOffset: -4
  14.  
  15. # If true, horizontally aligns arguments after an open bracket.
  16. # This applies to round brackets (parentheses), angle brackets and square brackets. This will result in formattings like code someLongFunction(argument1, argument2); endcode
  17. #AlignAfterOpenBracket: false
  18.  
  19. # If true, aligns escaped newlines as far left as possible. Otherwise puts them into the right-most column.
  20. #AlignEscapedNewlinesLeft
  21.  
  22. # If true, horizontally align operands of binary and ternary expressions.
  23. AlignOperands: true
  24.  
  25. # If true, aligns trailing comments.
  26. AlignTrailingComments: true
  27.  
  28. # Allow putting all parameters of a function declaration onto the next line even if BinPackParameters is false.
  29. AllowAllParametersOfDeclarationOnNextLine: false
  30.  
  31. # Allows contracting simple braced statements to a single line.
  32. # E.g., this allows if (a) { return; } to be put on a single line.
  33. AllowShortBlocksOnASingleLine: true
  34.  
  35. # If true, short case labels will be contracted to a single line.
  36. AllowShortCaseLabelsOnASingleLine: true
  37.  
  38. # Dependent on the value, int f() { return 0; } can be put on a single line.
  39. # SFS_None (in configuration: None) Never merge functions into a single line.
  40. # SFS_Inline (in configuration: Inline) Only merge functions defined inside a class.
  41. # SFS_Empty (in configuration: Empty) Only merge empty functions.
  42. # SFS_All (in configuration: All) Merge all functions fitting on a single line.
  43. AllowShortFunctionsOnASingleLine: Inline
  44.  
  45. # If true, if (a) return; can be put on a single line.
  46. #AllowShortIfStatementsOnASingleLine: false
  47.  
  48. # If true, while (true) continue; can be put on a single line.
  49. AllowShortLoopsOnASingleLine: true
  50.  
  51. # If true, always break after function definition return types.
  52. # More truthfully called ‘break before the identifier following the type in a function definition’. PenaltyReturnTypeOnItsOwnLine becomes irrelevant.
  53. AlwaysBreakAfterDefinitionReturnType: false
  54.  
  55. # If true, always break before multiline string literals.
  56. AlwaysBreakBeforeMultilineStrings: false
  57.  
  58. # If true, always break after the template<...> of a template declaration.
  59. AlwaysBreakTemplateDeclarations: true
  60.  
  61. # If false, a function call’s arguments will either be all on the same line or will have one line each.
  62. BinPackArguments: true
  63.  
  64. # If false, a function call’s arguments will either be all
  65. # on the same line or will have one line each.
  66. BinPackParameters: true
  67.  
  68. # The way to wrap binary operators.
  69. # BOS_None (in configuration: None) Break after operators.
  70. # BOS_NonAssignment (in configuration: NonAssignment) Break before operators that aren’t assignments.
  71. # BOS_All (in configuration: All) Break before operators.
  72. #BreakBeforeBinaryOperators: None
  73.  
  74. # The brace breaking style to use.
  75. # BS_Attach (in configuration: Attach) Always attach braces to surrounding context.
  76. # BS_Linux (in configuration: Linux) Like Attach, but break before braces on function, namespace and class definitions.
  77. # BS_Stroustrup (in configuration: Stroustrup) Like Attach, but break before function definitions, and ‘else’.
  78. # BS_Allman (in configuration: Allman) Always break before braces.
  79. # BS_GNU (in configuration: GNU) Always break before braces and add an extra level of indentation to braces of control statements, not to those of class, function or other definitions.
  80. BreakBeforeBraces: Allman
  81.  
  82. # If true, ternary operators will be placed after line breaks.
  83. BreakBeforeTernaryOperators: true
  84.  
  85. # Always break constructor initializers before commas and align the commas with the colon.
  86. BreakConstructorInitializersBeforeComma: true
  87.  
  88. # Always break constructor initializers before commas and align the commas with the colon.
  89. BreakConstructorInitializersBeforeComma: true
  90.  
  91. # The column limit.
  92. # A column limit of 0 means that there is no column limit. In this case, clang-format will respect the input’s line breaking decisions within statements unless they contradict other rules.
  93. ColumnLimit: 80
  94.  
  95. # A regular expression that describes comments with special meaning, which should not be split into lines or otherwise changed.
  96. CommentPragmas: "\/*(.*)*\/"
  97.  
  98. # If the constructor initializers don’t fit on a line, put each initializer on its own line.
  99. #ConstructorInitializerAllOnOneLineOrOnePerLine: false
  100.  
  101. # The number of characters to use for indentation of constructor initializer lists.
  102. ConstructorInitializerIndentWidth: 0
  103.  
  104. # Indent width for line continuations.
  105. #ContinuationIndentWidth: 4
  106.  
  107. # If true, format braced lists as best suited for C++11 braced lists.
  108. # Important differences: - No spaces inside the braced list. - No line break before the closing brace. - Indentation with the continuation indent, not with the block indent.
  109. # Fundamentally, C++11 braced lists are formatted exactly like function calls would be formatted in their place. If the braced list follows a name (e.g. a type or variable name), clang-format formats as if the {} were the parentheses of a function call with that name. If there is no name, a zero-length name is assumed.
  110. Cpp11BracedListStyle: true
  111.  
  112. # If true, analyze the formatted file for the most common alignment of & and *. Point
  113. #DerivePointerAlignment: false
  114.  
  115. # Disables formatting at all.
  116. #DisableFormat: false
  117.  
  118. # If true, clang-format detects whether function calls and definitions are formatted with one parameter per line.
  119. # Each call can be bin-packed, one-per-line or inconclusive. If it is inconclusive, e.g. completely on one line, but a decision needs to be made, clang-format analyzes whether there are other bin-packed cases in the input file and act accordingly.
  120. # NOTE: This is an experimental flag, that might go away or be renamed. Do not use this in config files, etc. Use at your own risk.
  121. #ExperimentalAutoDetectBinPacking: false
  122.  
  123. # A vector of macros that should be interpreted as foreach loops instead of as function calls.
  124. # These are expected to be macros of the form: code FOREACH(<variable-declaration>, ...) <loop-body> endcode
  125. # For example: BOOST_FOREACH.
  126. #ForEachMacros (std::vector<std::string>)
  127.  
  128. # Indent case labels one level from the switch statement.
  129. # When false, use the same indentation level as for the switch statement. Switch statement body is always indented one level more than case labels.
  130. IndentCaseLabels: false
  131.  
  132. # The number of columns to use for indentation.
  133. IndentWidth: 4
  134.  
  135. # Indent if a function definition or declaration is wrapped after the type.
  136. #IndentWrappedFunctionNames: false
  137.  
  138. # If true, empty lines at the start of blocks are kept.
  139. #KeepEmptyLinesAtTheStartOfBlocks: false
  140.  
  141. # Language, this format style is targeted at.
  142. # LK_None (in configuration: None) Do not use.
  143. # LK_Cpp (in configuration: Cpp) Should be used for C, C++, ObjectiveC, ObjectiveC++.
  144. # LK_Java (in configuration: Java) Should be used for Java.
  145. # LK_JavaScript (in configuration: JavaScript) Should be used for JavaScript.
  146. # LK_Proto (in configuration: Proto) Should be used for Protocol Buffers (https://developers.google.com/protocol-buffers/).
  147. Language: Cpp
  148.  
  149. # The maximum number of consecutive empty lines to keep.
  150. #MaxEmptyLinesToKeep: 0
  151.  
  152. # The indentation used for namespaces.
  153. # NI_None (in configuration: None) Don’t indent in namespaces.
  154. # NI_Inner (in configuration: Inner) Indent only in inner namespaces (nested in other namespaces).
  155. # NI_All (in configuration: All) Indent in all namespaces.
  156. #NamespaceIndentation: Inner
  157.  
  158. # The number of characters to use for indentation of ObjC blocks.
  159. #ObjCBlockIndentWidth: 4
  160.  
  161. # Add a space after @property in Objective-C, i.e. use \@property (readonly) instead of \@property(readonly).
  162. #ObjCSpaceAfterProperty: false
  163.  
  164. # Add a space in front of an Objective-C protocol list, i.e. use Foo <Protocol> instead of Foo<Protocol>.
  165. #ObjCSpaceBeforeProtocolList: false
  166.  
  167. # The penalty for breaking a function call after “call(”.
  168. #PenaltyBreakBeforeFirstCallParameter (unsigned)
  169.  
  170. # The penalty for each line break introduced inside a comment.
  171. #PenaltyBreakComment (unsigned)
  172.  
  173. # The penalty for breaking before the first <<.
  174. #PenaltyBreakFirstLessLess (unsigned)
  175.  
  176. # The penalty for each line break introduced inside a string literal.
  177. #PenaltyBreakString (unsigned)
  178.  
  179. # The penalty for each character outside of the column limit.
  180. #PenaltyExcessCharacter (unsigned)
  181.  
  182. # Penalty for putting the return type of a function onto its own line.
  183. #PenaltyReturnTypeOnItsOwnLine (unsigned)
  184.  
  185. # If true, analyze the formatted file for the most common alignment of & and *. PointerAlignment is then used only as fallback.
  186. PointerAlignment: Middle
  187.  
  188. # If true, a space may be inserted after C style casts.
  189. SpaceAfterCStyleCast: false
  190.  
  191. # If false, spaces will be removed before assignment operators.
  192. #SpaceBeforeAssignmentOperators: true
  193.  
  194. # Defines in which cases to put a space before opening parentheses.
  195. # SBPO_Never (in configuration: Never) Never put a space before opening parentheses.
  196. # SBPO_ControlStatements (in configuration: ControlStatements) Put a space before opening parentheses only after control statement keywords (for/if/while...).
  197. # SBPO_Always (in configuration: Always) Always put a space before opening parentheses, except when it’s prohibited by the syntax rules (in function-like macro definitions) or when determined by other style rules (after unary operators, opening parentheses, etc.)
  198. SpaceBeforeParens: Never
  199.  
  200. # If true, spaces may be inserted into ‘()’.
  201. SpaceInEmptyParentheses: false
  202.  
  203. # The number of spaces before trailing line comments (// - comments).
  204. # This does not affect trailing block comments (/**/ - comments) as those commonly have different usage patterns and a number of special cases.
  205. SpacesBeforeTrailingComments: 1
  206.  
  207. # If true, spaces will be inserted after ‘<’ and before ‘>’ in template argument lists
  208. SpacesInAngles: false
  209.  
  210. # If true, spaces may be inserted into C style casts.
  211. SpacesInCStyleCastParentheses: false
  212.  
  213. # If true, spaces are inserted inside container literals (e.g. ObjC and Javascript array and dict literals).
  214. SpacesInContainerLiterals: false
  215.  
  216. # If true, spaces will be inserted after ‘(‘ and before ‘)’.
  217. SpacesInParentheses: false
  218.  
  219. # If true, spaces will be inserted after ‘[‘ and before ‘]’.
  220. SpacesInSquareBrackets: false
  221.  
  222. # Format compatible with this standard, e.g. use A<A<int> > instead of A<A<int>> for LS_Cpp03.
  223. # LS_Cpp03 (in configuration: Cpp03) Use C++03-compatible syntax.
  224. # LS_Cpp11 (in configuration: Cpp11) Use features of C++11 (e.g. A<A<int>> instead of A<A<int> >).
  225. # LS_Auto (in configuration: Auto) Automatic detection based on the input.
  226. Standard: Cpp11
  227.  
  228. # The number of columns used for tab stops.
  229. #TabWidth: 4
  230.  
  231. # The way to use tab characters in the resulting file.
  232. # UT_Never (in configuration: Never) Never use tab.
  233. # UT_ForIndentation (in configuration: ForIndentation) Use tabs only for indentation.
  234. # UT_Always (in configuration: Always) Use tabs whenever we need to fill whitespace that spans at least from one tab stop to the next one.
  235. UseTab: Never
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement