-
Notifications
You must be signed in to change notification settings - Fork 12
/
.clang-format
120 lines (120 loc) · 14 KB
/
.clang-format
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# See https://releases.llvm.org/9.0.0/tools/clang/docs/ClangFormatStyleOptions.html for all options
AccessModifierOffset: -2 # [integer] The extra indent or outdent of access modifiers, e.g. public:
AlignAfterOpenBracket: Align # [Align/DontAlign/AlwaysBreak] If true, horizontally aligns arguments after an open bracket
AlignConsecutiveAssignments: false # [true/false] This will align the assignment operators of consecutive lines
AlignConsecutiveDeclarations: false # [true/false] This will align the declaration names of consecutive lines.
AlignConsecutiveMacros: false # [true/false] This will align C/C++ preprocessor macros of consecutive lines
AlignEscapedNewlines: Left # [DontAlign/Left/Right]
AlignOperands: true # [true/false] Horizontally align operands of binary and ternary expressions
AlignTrailingComments: true # [true/false] Aligns trailing comments
AllowAllArgumentsOnNextLine: false # [true/false] If a function call or braced initializer list doesn’t fit on a line, allow putting all arguments onto the next line
AllowAllConstructorInitializersOnNextLine: true # [true/false] If a constructor definition with a member initializer list doesn’t fit on a single line, allow putting all member initializers onto the next line
AllowAllParametersOfDeclarationOnNextLine: false # [true/false] If the function declaration doesn’t fit on a line, allow putting all parameters of a function declaration onto the next line
AllowShortBlocksOnASingleLine: true # [true/false] Dependent on the value, "while (true) { continue; }" can be put on a single line
AllowShortCaseLabelsOnASingleLine: false # [true/false] If true, short case labels will be contracted to a single line
AllowShortFunctionsOnASingleLine: All # [None/InlineOnly/Empty/Inline/All] Dependent on the value, "int f() { return 0; }" can be put on a single line
AllowShortIfStatementsOnASingleLine: WithoutElse # [Never/WithoutElse/Always] If true, "if (a) return;" can be put on a single line
AllowShortLambdasOnASingleLine: All # [None/Empty/Inline/All] Dependent on the value, "auto lambda []() { return 0; }" can be put on a single line
AllowShortLoopsOnASingleLine: true # [true/false] If true, while (true) continue; can be put on a single line
AlwaysBreakAfterDefinitionReturnType: None # [None/All/TopLevel] The function definition return type breaking style to use. This option is deprecated and is retained for backwards compatibility
AlwaysBreakAfterReturnType: None # [None/All/TopLevel/AllDefinitions/TopLevelDefinitions] The function declaration return type breaking style to use
AlwaysBreakBeforeMultilineStrings: false # [true/false] If true, always break before multiline string literals
AlwaysBreakTemplateDeclarations: Yes # [No/MultiLine/Yes] The template declaration breaking style to use
BinPackArguments: true # [true/false] If false, a function call’s arguments will either be all on the same line or will have one line each
BinPackParameters: true # [true/false] If false, a function declaration’s or function definition’s parameters will either all be on the same line or will have one line each
BraceWrapping:
AfterCaseLabel: true # [true/false] Wrap case labels
AfterClass: true # [true/false] Wrap class definitions
AfterControlStatement: true # [true/false] Wrap control statements (if/for/while/switch/..)
AfterEnum: true # [true/false] Wrap enum definitions
AfterFunction: true # [true/false] Wrap function definitions
AfterNamespace: true # [true/false] Wrap namespace definitions
AfterObjCDeclaration: true # [true/false] Wrap ObjC definitions (interfaces, implementations…)
AfterStruct: true # [true/false] Wrap struct definitions
AfterUnion: true # [true/false] Wrap union definitions
AfterExternBlock: true # [true/false] Wrap extern blocks
BeforeCatch: true # [true/false] Wrap before catch
BeforeElse: true # [true/false] Wrap before else
IndentBraces: false # [true/false] Indent the wrapped braces themselves
SplitEmptyFunction: false # [true/false] If false, empty function body can be put on a single line
SplitEmptyNamespace: false # [true/false] If false, empty namespace body can be put on a single line
SplitEmptyRecord: false # [true/false] If false, empty record (e.g. class, struct or union) body can be put on a single line
BreakAfterJavaFieldAnnotations: true # [true/false] Break after each annotation on a field in Java files
BreakBeforeBinaryOperators: NonAssignment # [None/NonAssignment/All] The way to wrap binary operators
BreakBeforeBraces: Custom # [Attach/Linux/Mozilla/Stroustrup/Allman/GNU/WebKit/Custom]
BreakBeforeTernaryOperators: true # [true/false] If true, ternary operators will be placed after line breaks
BreakConstructorInitializers: BeforeColon # [BeforeColon/BeforeComma/AfterColon] The constructor initializers style to use
BreakInheritanceList: BeforeColon # [BeforeColon/BeforeComma/AfterColon] The inheritance list style to use
BreakStringLiterals: true # [true/false] Allow breaking string literals when formatting
ColumnLimit: 0 # [unsigned] The column limit. A column limit of 0 means that there is no column limit
CommentPragmas: '^ IWYU pragma:' # [string] A regular expression that describes comments with special meaning, which should not be split into lines or otherwise changed
CompactNamespaces: false # [true/false] If true, consecutive namespace declarations will be on the same line. If false, each namespace is declared on a new line
ConstructorInitializerAllOnOneLineOrOnePerLine: true # [true/false] If the constructor initializers don’t fit on a line, put each initializer on its own line
ConstructorInitializerIndentWidth: 4 # [unsigned] The number of characters to use for indentation of constructor initializer lists as well as inheritance lists
ContinuationIndentWidth: 4 # [unsigned] Indent width for line continuations
Cpp11BracedListStyle: false # [true/false] If true, format braced lists as best suited for C++11 braced lists
DerivePointerAlignment: false # [true/false] If true, analyze the formatted file for the most common alignment of & and *
DisableFormat: false # [true/false] Disables formatting completely
ExperimentalAutoDetectBinPacking: false # [true/false] If true, clang-format detects whether function calls and definitions are formatted with one parameter per line
FixNamespaceComments: true # [true/false] If true, clang-format adds missing namespace end comments and fixes invalid existing ones
ForEachMacros: # [vector] A vector of macros that should be interpreted as foreach loops instead of as function calls
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Merge # [Preserve/Merge/Regroup] Dependent on the value, multiple #include blocks can be sorted as one and divided based on category
IncludeCategories: # [vector] Regular expressions denoting the different #include categories used for ordering #includes
- Regex: '^(<|")spdlog/.*/.*(>|")'
Priority: 2001
- Regex: '^(<|")spdlog/.*(>|")'
Priority: 2000
- Regex: '^(<|")docopt/.*/.*(>|")'
Priority: 2011
- Regex: '^(<|")docopt/.*(>|")'
Priority: 2010
- Regex: '^(<|")boost/.*/.*(>|")'
Priority: 2021
- Regex: '^(<|")boost/.*(>|")'
Priority: 2020
- Regex: '(<|").*/.*(>|")'
Priority: 3000
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: (Test)?$ # [string] Specify a regular expression of suffixes that are allowed in the file-to-main-include mapping
IndentCaseLabels: false # [true/false] Indent case labels one level from the switch statement
IndentPPDirectives: BeforeHash # [None/AfterHash/BeforeHash] The preprocessor directive indenting style to use
IndentWidth: 4 # [unsigned] The number of columns to use for indentation
IndentWrappedFunctionNames: true # [true/false] Indent if a function definition or declaration is wrapped after the type
JavaScriptQuotes: Leave # [Leave/Single/Double] The JavaScriptQuoteStyle to use for JavaScript strings
JavaScriptWrapImports: true # [true/false] Whether to wrap JavaScript import/export statements
KeepEmptyLinesAtTheStartOfBlocks: false # [true/false] If true, the empty line at the start of blocks is kept
Language: Cpp # [None/Cpp/CSharp/Java/JavaScript/ObjC/Proto/TableGen/TextProto] Language, this format style is targeted at
MacroBlockBegin: '' # [string] A regular expression matching macros that start a block
MacroBlockEnd: '' # [string] A regular expression matching macros that end a block
MaxEmptyLinesToKeep: 1 # [unsigned] The maximum number of consecutive empty lines to keep
NamespaceIndentation: None # [None/Inner/All] The indentation used for namespaces
ObjCBlockIndentWidth: 7 # [unsigned] The number of characters to use for indentation of ObjC blocks
ObjCSpaceAfterProperty: true # [true/false] Add a space after @property in Objective-C, i.e. use @property (readonly) instead of @property(readonly)
ObjCSpaceBeforeProtocolList: false # [true/false] Add a space in front of an Objective-C protocol list, i.e. use Foo <Protocol> instead of Foo<Protocol>
PointerAlignment: Left # [Left/Right/Middle] Pointer and reference alignment style
ReflowComments: true # [true/false] If true, clang-format will attempt to re-flow comments
SortIncludes: false # [true/false] If true, clang-format will sort #includes
SortUsingDeclarations: false # [true/false] If true, clang-format will sort using declarations
SpaceAfterCStyleCast: false # [true/false] If true, a space is inserted after C style casts
SpaceAfterLogicalNot: false # [true/false] If true, a space is inserted after the logical not operator (!)
SpaceAfterTemplateKeyword: false # [true/false] If true, a space will be inserted after the ‘template’ keyword
SpaceBeforeAssignmentOperators: true # [true/false] If false, spaces will be removed before assignment operators
SpaceBeforeCpp11BracedList: false # [true/false] If true, a space will be inserted before a C++11 braced list used to initialize an object (after the preceding identifier or type)
SpaceBeforeCtorInitializerColon: true # [true/false] If false, spaces will be removed before constructor initializer colon
SpaceBeforeInheritanceColon: true # [true/false] If false, spaces will be removed before inheritance colon
SpaceBeforeParens: ControlStatements # [Never/ControlStatements/NonEmptyParentheses/Always] Defines in which cases to put a space before opening parentheses
SpaceBeforeRangeBasedForLoopColon: true # [true/false] If false, spaces will be removed before range-based for loop colon
SpaceInEmptyParentheses: false # [true/false] If true, spaces may be inserted into ()
SpacesBeforeTrailingComments: 1 # [unsigned] The number of spaces before trailing line comments (// - comments)
SpacesInAngles: false # [true/false] If true, spaces will be inserted after < and before > in template argument lists
SpacesInCStyleCastParentheses: false # [true/false] If true, spaces may be inserted into C style casts
SpacesInContainerLiterals: true # [true/false] If true, spaces are inserted inside container literals (e.g. ObjC and Javascript array and dict literals)
SpacesInParentheses: false # [true/false] If true, spaces will be inserted after ( and before )
SpacesInSquareBrackets: false # [true/false] If true, spaces will be inserted after [ and before ]. Lambdas or unspecified size array declarations will not be affected
Standard: Cpp11 # [Cpp03/Cpp11/Auto] Format compatible with this standard, e.g. use A<A<int> > instead of A<A<int>> for LS_Cpp03
TabWidth: 4 # [unsigned] The number of columns used for tab stops
UseTab: Never # [Never/ForIndentation/ForContinuationAndIndentation/Always] The way to use tab characters in the resulting file