|
1 | 1 | BasedOnStyle: Google
|
2 | 2 |
|
3 |
| -## The extra indent or outdent of access modifiers, e.g. public:. |
4 |
| -#AccessModifierOffset: -1 |
5 |
| -# |
6 |
| -## If true, aligns escaped newlines as far left as possible. Otherwise puts them into the right-most column. |
7 |
| -#AlignEscapedNewlinesLeft: false |
8 |
| -# |
9 |
| -## If true, aligns trailing comments. |
10 |
| -#AlignTrailingComments: true |
11 |
| -# |
12 |
| -## Allow putting all parameters of a function declaration onto the next line even if BinPackParameters is false. |
13 |
| -#AllowAllParametersOfDeclarationOnNextLine: false |
14 |
| - |
15 |
| -# If true, if (a) return; can be put on a single line. |
| 3 | +# If true, if (a) return; can be put on a single line. |
16 | 4 | AllowShortIfStatementsOnASingleLine: false
|
17 | 5 |
|
18 |
| -# If true, while (true) continue; can be put on a single line. |
| 6 | +# If true, while (true) continue; can be put on a single line. |
19 | 7 | AllowShortLoopsOnASingleLine: false
|
20 | 8 |
|
| 9 | +# Dependent on the value, int f() { return 0; } can be put on a single line. |
21 | 10 | AllowShortFunctionsOnASingleLine: true
|
22 | 11 |
|
23 |
| -## If true, always break before multiline string literals. |
24 |
| -#AlwaysBreakBeforeMultilineStrings: false |
25 |
| -# |
26 |
| -## If true, always break after the template<...> of a template declaration. |
27 |
| -#AlwaysBreakTemplateDeclarations: false |
28 |
| -# |
29 |
| -## If false, a function call’s or function definition’s parameters will either all be on the same line or will have one line each. |
30 |
| -#BinPackParameters: false |
31 |
| -# |
32 |
| -## If true, binary operators will be placed after line breaks. |
33 |
| -#BreakBeforeBinaryOperators: false |
34 |
| -# |
35 |
| -## The brace breaking style to use. |
36 |
| -## Possible values: |
37 |
| -## BS_Attach (in configuration: Attach) Always attach braces to surrounding context. |
38 |
| -## BS_Linux (in configuration: Linux) Like Attach, but break before braces on function, namespace and class definitions. |
39 |
| -## BS_Stroustrup (in configuration: Stroustrup) Like Attach, but break before function definitions. |
40 |
| -## BS_Allman (in configuration: Allman) Always break before braces. |
41 |
| -#BreakBeforeBraces: Linux |
42 |
| -# |
43 |
| -## Always break constructor initializers before commas and align the commas with the colon. |
44 |
| -#BreakConstructorInitializersBeforeComma: true |
45 |
| -# |
46 |
| -## The column limit. |
47 |
| -## 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. |
| 12 | +# The column limit. |
| 13 | +# 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. |
48 | 14 | ColumnLimit: 80
|
49 |
| -# |
50 |
| -## If the constructor initializers don’t fit on a line, put each initializer on its own line. |
51 |
| -##ConstructorInitializerAllOnOneLineOrOnePerLine (bool) |
52 |
| -# |
53 |
| -## The number of characters to use for indentation of constructor initializer lists. |
54 |
| -##ConstructorInitializerIndentWidth (unsigned) |
55 |
| -# |
56 |
| -## If true, format braced lists as best suited for C++11 braced lists. |
57 |
| -## 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. |
58 |
| -## 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. |
| 15 | + |
| 16 | +# If true, format braced lists as best suited for C++11 braced lists. |
59 | 17 | Cpp11BracedListStyle: true
|
60 |
| -# |
61 |
| -## If true, analyze the formatted file for the most common binding. |
62 |
| -##DerivePointerBinding (bool) |
63 |
| -# |
64 |
| -## If true, clang-format detects whether function calls and definitions are formatted with one parameter per line. |
65 |
| -## 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. |
66 |
| -## 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. |
67 |
| -##ExperimentalAutoDetectBinPacking (bool) |
68 |
| -# |
69 |
| -## Indent case labels one level from the switch statement. |
70 |
| -## When false, use the same indentation level as for the switch statement. Switch statement body is always indented one level more than case labels. |
71 |
| -#IndentCaseLabels: false |
72 |
| -# |
73 |
| -## If true, indent when breaking function declarations which are not also definitions after the type. |
74 |
| -##IndentFunctionDeclarationAfterType (bool) |
75 |
| -# |
76 |
| -## The number of characters to use for indentation. |
77 |
| -#IndentWidth: 2 |
78 |
| -# |
79 |
| -## The maximum number of consecutive empty lines to keep. |
80 |
| -#MaxEmptyLinesToKeep: 1 |
81 |
| -# |
82 |
| -## The indentation used for namespaces. |
83 |
| -## Possible values: |
84 |
| -## NI_None (in configuration: None) Don’t indent in namespaces. |
85 |
| -## NI_Inner (in configuration: Inner) Indent only in inner namespaces (nested in other namespaces). |
86 |
| -## NI_All (in configuration: All) Indent in all namespaces. |
87 |
| -#NamespaceIndentation: None |
88 |
| -# |
89 |
| -## Add a space in front of an Objective-C protocol list, i.e. use Foo <Protocol> instead of Foo<Protocol>. |
90 |
| -##ObjCSpaceBeforeProtocolList (bool) |
91 |
| -# |
92 |
| -## The penalty for each line break introduced inside a comment. |
93 |
| -##PenaltyBreakComment (unsigned) |
94 |
| -# |
95 |
| -## The penalty for breaking before the first <<. |
96 |
| -##PenaltyBreakFirstLessLess (unsigned) |
97 |
| -# |
98 |
| -## The penalty for each line break introduced inside a string literal. |
99 |
| -##PenaltyBreakString (unsigned) |
100 |
| -## The penalty for each character outside of the column limit. |
101 |
| -##PenaltyExcessCharacter (unsigned) |
102 |
| -## Penalty for putting the return type of a function onto its own line. |
103 |
| -##PenaltyReturnTypeOnItsOwnLine (unsigned) |
104 |
| -## Set whether & and * bind to the type as opposed to the variable. |
105 |
| -##PointerBindsToType: false |
106 |
| -## If true, spaces will be inserted between ‘for’/’if’/’while’/... and ‘(‘. |
107 |
| -##SpaceAfterControlStatementKeyword: true |
108 |
| -## If false, spaces will be removed before ‘=’, ‘+=’, etc. |
109 |
| -##SpaceBeforeAssignmentOperators: true |
110 |
| -## If false, spaces may be inserted into ‘()’. |
111 |
| -##SpaceInEmptyParentheses: false |
112 |
| -## The number of spaces to before trailing line comments. |
113 |
| -##SpacesBeforeTrailingComments (unsigned) |
114 |
| -## If false, spaces may be inserted into C style casts. |
115 |
| -##SpacesInCStyleCastParentheses (bool) |
116 |
| -# |
117 |
| -## If true, spaces will be inserted after every ‘(‘ and before every ‘)’. |
118 |
| -#SpacesInParentheses: false |
119 |
| -# |
120 |
| -## Format compatible with this standard, e.g. use A<A<int> > instead of A<A<int>> for LS_Cpp03. |
121 |
| -## Possible values: |
122 |
| -## LS_Cpp03 (in configuration: Cpp03) Use C++03-compatible syntax. |
123 |
| -## LS_Cpp11 (in configuration: Cpp11) Use features of C++11 (e.g. A<A<int>> instead of A<A<int> >). |
124 |
| -## LS_Auto (in configuration: Auto) Automatic detection based on the input. |
| 18 | + |
| 19 | +# Format compatible with this standard, e.g. use A<A<int> > instead of A<A<int>> for LS_Cpp03. |
| 20 | +# Possible values: |
| 21 | +# LS_Cpp03 (in configuration: Cpp03) Use C++03-compatible syntax. |
| 22 | +# LS_Cpp11 (in configuration: Cpp11) Use features of C++11 (e.g. A<A<int>> instead of A<A<int> >). |
| 23 | +# LS_Auto (in configuration: Auto) Automatic detection based on the input. |
125 | 24 | Standard: Cpp11
|
126 |
| -# |
127 |
| -## If true, IndentWidth consecutive spaces will be replaced with tab characters. |
128 |
| -#UseTab: false |
129 | 25 |
|
130 |
| -# vim: ft=yaml |
| 26 | +# Regular expressions denoting the different #include categories used for ordering #includes. |
| 27 | +# - POSIX extended regular expressions are supported. |
| 28 | +# - These regular expressions are matched against the filename of an include (including the <> or "") in order. |
| 29 | +# - The value belonging to the first matching regular expression is assigned and #includes are sorted |
| 30 | +# first according to increasing category number and then alphabetically within each category. |
| 31 | +# - If none of the regular expressions match, INT_MAX is assigned as category. |
| 32 | +# - The main header for a source file automatically gets category 0 so that it is generally kept at |
| 33 | +# the beginning of the #includes (https://llvm.org/docs/CodingStandards.html#include-style). |
| 34 | +# However, you can also assign negative priorities if you have certain headers that always need to be first. |
| 35 | +# |
| 36 | +# NOTE: Include here all regex to fulfill Google style guide -> https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes |
| 37 | +IncludeCategories: |
| 38 | + - Regex: '^(<|")vir/test\.h(>|")' # This has always to be included first => Negative priority |
| 39 | + Priority: -1 |
| 40 | + CaseSensitive: true |
| 41 | + - Regex: '^<(sys/)?[^/]*\.h>' |
| 42 | + Priority: 1 |
| 43 | + SortPriority: 0 |
| 44 | + CaseSensitive: false |
| 45 | + - Regex: '^<[[:alnum:]._]+>' |
| 46 | + Priority: 2 |
| 47 | + SortPriority: 0 |
| 48 | + CaseSensitive: false |
| 49 | + - Regex: '^(<|"(Eigen|gsl|HepMC3|Pythia8|Rivet|vir|yaml-cpp)/)[^/]*' |
| 50 | + Priority: 3 |
| 51 | + SortPriority: 0 |
| 52 | + CaseSensitive: false |
| 53 | + - Regex: '^"einhard\.hpp"' |
| 54 | + Priority: 3 |
| 55 | + SortPriority: 0 |
| 56 | + CaseSensitive: false |
| 57 | + - Regex: '^(<|")smash/.*\.h(>|")' # SMASH include should be left in the last block |
| 58 | + Priority: 4 |
| 59 | + CaseSensitive: false |
| 60 | + - Regex: '.*' |
| 61 | + Priority: 4 |
| 62 | + SortPriority: 0 |
| 63 | + CaseSensitive: false |
0 commit comments