|
| 1 | +# Docs: |
| 2 | +# http://clang.llvm.org/docs/ClangFormatStyleOptions.html |
| 3 | + |
| 4 | +# The style used for all options not specifically set in the configuration. |
| 5 | +# Available options: LLVM, Google, Chromium, Mozilla, WebKit |
| 6 | +BasedOnStyle: Google |
| 7 | + |
| 8 | +# The extra indent or outdent of access modifiers, e.g. public:. |
| 9 | +AccessModifierOffset: -4 |
| 10 | + |
| 11 | +# If true, horizontally aligns arguments after an open bracket. |
| 12 | +# This applies to round brackets (parentheses), angle brackets and square brackets. This will result in formattings like code someLongFunction(argument1, argument2); endcode |
| 13 | +AlignAfterOpenBracket: AlwaysBreak |
| 14 | + |
| 15 | +# If true, aligns escaped newlines as far left as possible. Otherwise puts them into the right-most column. |
| 16 | +AlignEscapedNewlinesLeft: Left |
| 17 | + |
| 18 | +# If true, horizontally align operands of binary and ternary expressions. |
| 19 | +AlignOperands: true |
| 20 | + |
| 21 | +# If true, aligns trailing comments. |
| 22 | +AlignTrailingComments: false |
| 23 | + |
| 24 | +# If a function call or braced initializer list doesn’t fit on a line, allow putting all arguments onto the next line, even if BinPackArguments is false. |
| 25 | +AllowAllArgumentsOnNextLine: false |
| 26 | + |
| 27 | +# Allow putting all parameters of a function declaration onto the next line even if BinPackParameters is false. |
| 28 | +AllowAllParametersOfDeclarationOnNextLine: false |
| 29 | + |
| 30 | +# Allows contracting simple braced statements to a single line. |
| 31 | +# E.g., this allows if (a) { return; } to be put on a single line. |
| 32 | +# Shayan: I set it to false. I think if you want to create a single line block, |
| 33 | +# might as well just not create the block in the first place. |
| 34 | +AllowShortBlocksOnASingleLine: false |
| 35 | + |
| 36 | +# If true, short case labels will be contracted to a single line. |
| 37 | +AllowShortCaseLabelsOnASingleLine: true |
| 38 | + |
| 39 | +# Dependent on the value, int f() { return 0; } can be put on a single line. |
| 40 | +# SFS_None (in configuration: None) Never merge functions into a single line. |
| 41 | +# SFS_Inline (in configuration: Inline) Only merge functions defined inside a class. |
| 42 | +# SFS_Empty (in configuration: Empty) Only merge empty functions. |
| 43 | +# SFS_All (in configuration: All) Merge all functions fitting on a single line. |
| 44 | +AllowShortFunctionsOnASingleLine: Inline |
| 45 | + |
| 46 | +# If true, if (a) return; can be put on a single line. |
| 47 | +# Lagrange convention: |
| 48 | +# if( condition ) do something; -> YES |
| 49 | +# if( condition ) |
| 50 | +# do something; -> DON'T |
| 51 | +AllowShortIfStatementsOnASingleLine: true |
| 52 | + |
| 53 | +# Dependent on the value, auto lambda []() { return 0; } can be put on a single line. |
| 54 | +AllowShortLambdasOnASingleLine: All |
| 55 | + |
| 56 | +# If true, while (true) continue; can be put on a single line. |
| 57 | +# Lagrange convention: |
| 58 | +# while( condition ) do something; -> YES |
| 59 | +# while( condition ) |
| 60 | +# do something; -> DON'T |
| 61 | +AllowShortLoopsOnASingleLine: true |
| 62 | + |
| 63 | +# The function definition return type breaking style to use. This option is deprecated and is |
| 64 | +# retained for backwards compatibility. |
| 65 | +# AlwaysBreakAfterDefinitionReturnType: false |
| 66 | + |
| 67 | +# If true, always break before multiline string literals. |
| 68 | +AlwaysBreakBeforeMultilineStrings: false |
| 69 | + |
| 70 | +# If true, always break after the template<...> of a template declaration. |
| 71 | +AlwaysBreakTemplateDeclarations: true |
| 72 | + |
| 73 | +# If false, a function call's arguments will either be all on the same line or will have one line each. |
| 74 | +BinPackArguments: false |
| 75 | + |
| 76 | +# If false, a function call's arguments will either be all |
| 77 | +# on the same line or will have one line each. |
| 78 | +BinPackParameters: false |
| 79 | + |
| 80 | +# The way to wrap binary operators. |
| 81 | +# BOS_None (in configuration: None) Break after operators. |
| 82 | +# BOS_NonAssignment (in configuration: NonAssignment) Break before operators that aren't assignments. |
| 83 | +# BOS_All (in configuration: All) Break before operators. |
| 84 | +#BreakBeforeBinaryOperators: None |
| 85 | + |
| 86 | +# The brace breaking style to use. |
| 87 | +# BS_Attach (in configuration: Attach) Always attach braces to surrounding context. |
| 88 | +# BS_Linux (in configuration: Linux) Like Attach, but break before braces on function, namespace and class definitions. |
| 89 | +# BS_Stroustrup (in configuration: Stroustrup) Like Attach, but break before function definitions, and `else`. |
| 90 | +# BS_Allman (in configuration: Allman) Always break before braces. |
| 91 | +# 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. |
| 92 | +BraceWrapping: |
| 93 | + AfterClass: true |
| 94 | + AfterControlStatement: false |
| 95 | + AfterEnum: false |
| 96 | + AfterFunction: true |
| 97 | + AfterNamespace: false |
| 98 | + AfterObjCDeclaration: false |
| 99 | + AfterStruct: true |
| 100 | + AfterUnion: false |
| 101 | + BeforeCatch: false |
| 102 | + BeforeElse: false |
| 103 | + IndentBraces: false |
| 104 | + SplitEmptyFunction: false |
| 105 | +BreakBeforeBraces: Custom |
| 106 | + |
| 107 | +# If true, ternary operators will be placed after line breaks. |
| 108 | +BreakBeforeTernaryOperators: true |
| 109 | + |
| 110 | +# Always break constructor initializers before commas and align the commas with the colon. |
| 111 | +BreakConstructorInitializersBeforeComma: true |
| 112 | + |
| 113 | +# The column limit. |
| 114 | +# 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. |
| 115 | +ColumnLimit: 100 |
| 116 | + |
| 117 | +# A regular expression that describes comments with special meaning, which should not be split into lines or otherwise changed. |
| 118 | +CommentPragmas: "\/*(.*)*\/" |
| 119 | + |
| 120 | +# If the constructor initializers don't fit on a line, put each initializer on its own line. |
| 121 | +ConstructorInitializerAllOnOneLineOrOnePerLine: false |
| 122 | + |
| 123 | +# The number of characters to use for indentation of constructor initializer lists. |
| 124 | +ConstructorInitializerIndentWidth: 4 |
| 125 | + |
| 126 | +# Indent width for line continuations. |
| 127 | +# A little more than normal indent |
| 128 | +ContinuationIndentWidth: 4 |
| 129 | + |
| 130 | +# If true, format braced lists as best suited for C++11 braced lists. |
| 131 | +# 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. |
| 132 | +# 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. |
| 133 | +Cpp11BracedListStyle: true |
| 134 | + |
| 135 | +# If true, analyze the formatted file for the most common alignment of & and *. Point |
| 136 | +DerivePointerAlignment: false |
| 137 | + |
| 138 | +# Disables formatting at all. |
| 139 | +#DisableFormat: false |
| 140 | + |
| 141 | +# If true, clang-format detects whether function calls and definitions are formatted with one parameter per line. |
| 142 | +# 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. |
| 143 | +# 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. |
| 144 | +#ExperimentalAutoDetectBinPacking: false |
| 145 | + |
| 146 | +# If true, clang-format adds missing namespace end comments and fixes invalid existing ones. |
| 147 | +FixNamespaceComments: true |
| 148 | + |
| 149 | +# A vector of macros that should be interpreted as foreach loops instead of as function calls. |
| 150 | +# These are expected to be macros of the form: code FOREACH(<variable-declaration>, ...) <loop-body> endcode |
| 151 | +# For example: BOOST_FOREACH. |
| 152 | +#ForEachMacros (std::vector<std::string>) |
| 153 | + |
| 154 | +# Dependent on the value, multiple #include blocks can be sorted as one and divided based on category. |
| 155 | +IncludeBlocks: Preserve |
| 156 | + |
| 157 | +# Indent case labels one level from the switch statement. |
| 158 | +# When false, use the same indentation level as for the switch statement. Switch statement body is always indented one level more than case labels. |
| 159 | +IndentCaseLabels: false |
| 160 | + |
| 161 | +# The preprocessor directive indenting style to use. |
| 162 | +IndentPPDirectives: BeforeHash |
| 163 | + |
| 164 | +# The number of columns to use for indentation. |
| 165 | +IndentWidth: 4 |
| 166 | + |
| 167 | +# Indent if a function definition or declaration is wrapped after the type. |
| 168 | +#IndentWrappedFunctionNames: false |
| 169 | + |
| 170 | +# If true, empty lines at the start of blocks are kept. |
| 171 | +#KeepEmptyLinesAtTheStartOfBlocks: false |
| 172 | + |
| 173 | +# Language, this format style is targeted at. |
| 174 | +# LK_None (in configuration: None) Do not use. |
| 175 | +# LK_Cpp (in configuration: Cpp) Should be used for C, C++, ObjectiveC, ObjectiveC++. |
| 176 | +# LK_Java (in configuration: Java) Should be used for Java. |
| 177 | +# LK_JavaScript (in configuration: JavaScript) Should be used for JavaScript. |
| 178 | +# LK_Proto (in configuration: Proto) Should be used for Protocol Buffers (https://developers.google.com/protocol-buffers/). |
| 179 | +Language: Cpp |
| 180 | + |
| 181 | +# The maximum number of consecutive empty lines to keep. |
| 182 | +MaxEmptyLinesToKeep: 2 |
| 183 | + |
| 184 | +# The indentation used for namespaces. |
| 185 | +# NI_None (in configuration: None) Don't indent in namespaces. |
| 186 | +# NI_Inner (in configuration: Inner) Indent only in inner namespaces (nested in other namespaces). |
| 187 | +# NI_All (in configuration: All) Indent in all namespaces. |
| 188 | +NamespaceIndentation: None |
| 189 | + |
| 190 | +# The number of characters to use for indentation of ObjC blocks. |
| 191 | +#ObjCBlockIndentWidth: 4 |
| 192 | + |
| 193 | +# Add a space after @property in Objective-C, i.e. use \@property (readonly) instead of \@property(readonly). |
| 194 | +#ObjCSpaceAfterProperty: false |
| 195 | + |
| 196 | +# Add a space in front of an Objective-C protocol list, i.e. use Foo <Protocol> instead of Foo<Protocol>. |
| 197 | +#ObjCSpaceBeforeProtocolList: false |
| 198 | + |
| 199 | +# The penalty for breaking a function call after `call(`. |
| 200 | +#PenaltyBreakBeforeFirstCallParameter (unsigned) |
| 201 | + |
| 202 | +# The penalty for each line break introduced inside a comment. |
| 203 | +#PenaltyBreakComment (unsigned) |
| 204 | + |
| 205 | +# The penalty for breaking before the first <<. |
| 206 | +#PenaltyBreakFirstLessLess (unsigned) |
| 207 | + |
| 208 | +# The penalty for each line break introduced inside a string literal. |
| 209 | +#PenaltyBreakString (unsigned) |
| 210 | + |
| 211 | +# The penalty for each character outside of the column limit. |
| 212 | +#PenaltyExcessCharacter (unsigned) |
| 213 | + |
| 214 | +# Penalty for putting the return type of a function onto its own line. |
| 215 | +#PenaltyReturnTypeOnItsOwnLine (unsigned) |
| 216 | + |
| 217 | +# Pointer and reference alignment style. |
| 218 | +PointerAlignment: Left |
| 219 | + |
| 220 | +# If true, clang-format will attempt to re-flow comments. |
| 221 | +ReflowComments: true |
| 222 | + |
| 223 | +# Add a space before parentheses |
| 224 | +# if (condition) -> tick |
| 225 | +# if(condition) -> cross |
| 226 | +SpaceBeforeParens: ControlStatements |
| 227 | + |
| 228 | +# If true, a space may be inserted after C style casts. |
| 229 | +SpaceAfterCStyleCast: false |
| 230 | + |
| 231 | +# If false, spaces will be removed before assignment operators. |
| 232 | +#SpaceBeforeAssignmentOperators: true |
| 233 | + |
| 234 | +# If true, spaces may be inserted into `()`. |
| 235 | +SpaceInEmptyParentheses: false |
| 236 | + |
| 237 | +# The number of spaces before trailing line comments (// - comments). |
| 238 | +# This does not affect trailing block comments (/**/ - comments) as those commonly have different usage patterns and a number of special cases. |
| 239 | +SpacesBeforeTrailingComments: 1 |
| 240 | + |
| 241 | +# If true, spaces will be inserted after `<` and before `>` in template argument lists |
| 242 | +SpacesInAngles: false |
| 243 | + |
| 244 | +# If true, spaces may be inserted into C style casts. |
| 245 | +SpacesInCStyleCastParentheses: false |
| 246 | + |
| 247 | +# If true, spaces are inserted inside container literals (e.g. ObjC and Javascript array and dict literals). |
| 248 | +SpacesInContainerLiterals: false |
| 249 | + |
| 250 | +# If true, spaces will be inserted after `(` and before `)`. |
| 251 | +SpacesInParentheses: false |
| 252 | + |
| 253 | +# If true, spaces will be inserted after `[` and before `]`. |
| 254 | +SpacesInSquareBrackets: false |
| 255 | + |
| 256 | +# Format compatible with this standard, e.g. use A<A<int> > instead of A<A<int>> for LS_Cpp03. |
| 257 | +# LS_Cpp03 (in configuration: Cpp03) Use C++03-compatible syntax. |
| 258 | +# LS_Cpp11 (in configuration: Cpp11) Use features of C++11 (e.g. A<A<int>> instead of A<A<int> >). |
| 259 | +# LS_Auto (in configuration: Auto) Automatic detection based on the input. |
| 260 | +Standard: Cpp11 |
| 261 | + |
| 262 | +# The number of columns used for tab stops. |
| 263 | +TabWidth: 4 |
| 264 | + |
| 265 | +# The way to use tab characters in the resulting file. |
| 266 | +# UT_Never (in configuration: Never) Never use tab. |
| 267 | +# UT_ForIndentation (in configuration: ForIndentation) Use tabs only for indentation. |
| 268 | +# 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. |
| 269 | +UseTab: Never |
0 commit comments