Skip to content

Commit 7d68795

Browse files
authored
Update clang format (NVIDIA#2524)
Update clang format Works with TYPE_SWITHC macros (by mostly ignoring them) More options specified that were introduced Signed-off-by: Krzysztof Lecki <[email protected]>
1 parent 1b0053d commit 7d68795

File tree

1 file changed

+33
-25
lines changed

1 file changed

+33
-25
lines changed

.clang-format

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,37 @@ Language: Cpp
33
# BasedOnStyle: Google
44
AccessModifierOffset: -1
55
AlignAfterOpenBracket: Align
6+
AlignConsecutiveMacros: false
67
AlignConsecutiveAssignments: false
8+
AlignConsecutiveBitFields: false
79
AlignConsecutiveDeclarations: false
810
AlignEscapedNewlines: Left
9-
AlignOperands: true
11+
AlignOperands: Align
1012
AlignTrailingComments: true
13+
# Arguments can be moved to next line if they all will fit
14+
AllowAllArgumentsOnNextLine: true
15+
AllowAllConstructorInitializersOnNextLine: true
1116
AllowAllParametersOfDeclarationOnNextLine: true
12-
AllowShortBlocksOnASingleLine: false
17+
AllowShortEnumsOnASingleLine: false
18+
AllowShortBlocksOnASingleLine: Empty
1319
AllowShortCaseLabelsOnASingleLine: false
1420
# Empty and Inline instead of ALL
1521
AllowShortFunctionsOnASingleLine: Empty
16-
AllowShortIfStatementsOnASingleLine: true
17-
AllowShortLoopsOnASingleLine: true
18-
AlwaysBreakAfterDefinitionReturnType: None
22+
AllowShortIfStatementsOnASingleLine: Never
23+
AllowShortLoopsOnASingleLine: false
1924
AlwaysBreakAfterReturnType: None
2025
AlwaysBreakBeforeMultilineStrings: true
21-
AlwaysBreakTemplateDeclarations: true
26+
AlwaysBreakTemplateDeclarations: Yes
27+
# false to split arguments one for line
2228
BinPackArguments: true
2329
BinPackParameters: true
24-
BraceWrapping:
25-
AfterClass: false
26-
AfterControlStatement: false
27-
AfterEnum: false
28-
AfterFunction: false
29-
AfterNamespace: false
30-
AfterObjCDeclaration: false
31-
AfterStruct: false
32-
AfterUnion: false
33-
AfterExternBlock: false
34-
BeforeCatch: false
35-
BeforeElse: false
36-
IndentBraces: false
37-
SplitEmptyFunction: true
38-
SplitEmptyRecord: true
39-
SplitEmptyNamespace: true
4030
BreakBeforeBinaryOperators: None
4131
BreakBeforeBraces: Attach
42-
BreakBeforeInheritanceComma: false
43-
BreakBeforeTernaryOperators: true
32+
BreakInheritanceList: BeforeColon
33+
BreakBeforeTernaryOperators: false
4434
BreakConstructorInitializersBeforeComma: false
35+
BreakBeforeInheritanceComma: false
36+
# AfterColon looks better, but BeforeColon is set by GSG
4537
BreakConstructorInitializers: BeforeColon
4638
BreakAfterJavaFieldAnnotations: false
4739
BreakStringLiterals: true
@@ -73,15 +65,19 @@ IncludeCategories:
7365
Priority: 3
7466
IncludeIsMainRegex: '([-_](test|unittest))?$'
7567
IndentCaseLabels: true
68+
IndentCaseBlocks: false
69+
IndentGotoLabels: true
7670
IndentPPDirectives: None
71+
IndentExternBlock: NoIndent
7772
IndentWidth: 2
7873
IndentWrappedFunctionNames: false
74+
InsertTrailingCommas: None
7975
JavaScriptQuotes: Leave
8076
JavaScriptWrapImports: true
8177
KeepEmptyLinesAtTheStartOfBlocks: false
8278
MacroBlockBegin: ''
8379
MacroBlockEnd: ''
84-
MaxEmptyLinesToKeep: 1
80+
MaxEmptyLinesToKeep: 2
8581
NamespaceIndentation: None
8682
ObjCBlockIndentWidth: 2
8783
ObjCSpaceAfterProperty: false
@@ -98,18 +94,30 @@ ReflowComments: true
9894
SortIncludes: true
9995
SortUsingDeclarations: true
10096
SpaceAfterCStyleCast: false
97+
SpaceAfterLogicalNot: false
10198
SpaceAfterTemplateKeyword: true
10299
SpaceBeforeAssignmentOperators: true
100+
SpaceBeforeCpp11BracedList: false
101+
SpaceBeforeCtorInitializerColon: true
102+
SpaceBeforeInheritanceColon: true
103103
SpaceBeforeParens: ControlStatements
104+
SpaceBeforeRangeBasedForLoopColon: true
105+
SpaceInEmptyBlock: false
104106
SpaceInEmptyParentheses: false
105107
SpacesBeforeTrailingComments: 2
106108
SpacesInAngles: false
109+
SpacesInConditionalStatement: false
107110
SpacesInContainerLiterals: true
108111
SpacesInCStyleCastParentheses: false
109112
SpacesInParentheses: false
110113
SpacesInSquareBrackets: false
114+
SpaceBeforeSquareBrackets: false
111115
Standard: Auto
112116
TabWidth: 8
117+
UseCRLF: false
113118
UseTab: Never
119+
WhitespaceSensitiveMacros:
120+
- TYPE_SWITCH
121+
- VALUE_SWITCH
114122
...
115123

0 commit comments

Comments
 (0)