Repository navigation
Expand file tree
/
Copy path_format_cpp_clang
More file actions
117 lines (104 loc) · 3.28 KB
/
Copy path_format_cpp_clang
File metadata and controls
117 lines (104 loc) · 3.28 KB
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
#
# Documentation at https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#
# Let clang-format detect based on the extension
# Language: Cpp
# C++ standard
Standard: c++20
BasedOnStyle: LLVM
# Space indents, LF Line ending & 80 cols
UseTab: false
UseCRLF: false
LineEnding: LF
IndentWidth: 2
ContinuationIndentWidth: 2
MaxEmptyLinesToKeep: 1
ColumnLimit: 80
InsertNewlineAtEOF: true
# Preprocessor
PPIndentWidth: 2
IndentPPDirectives: BeforeHash
SortIncludes: false
# niLang/niCC macros
ForEachMacros: ["niLoop","niLoopr","niLoopit","niLooprit","niExec","niExec_","niSubmit","niSubmit_"]
StatementAttributeLikeMacros: ["niAlignedType","niAligned","niFn","niFnS","niFnV"]
TypenameMacros: ["niExportFunc","niExportFuncCPP","niFn","niFnS","niFnV","niExportFn","niNamespace","niDeprecated"]
IfMacros: ["niCheckIfError","niIfConstructError","niCheckNNIfNull","niTry","niTryError","niCatch","niCatchAll","niCatchError"]
WhitespaceSensitiveMacros:
- niDeclareInterfaceUUID
- niCAssert
- niNamespace
- niFourCC
- niMakeVersion
- niMessageID
- EA_DISABLE_GCC_WARNING
- EA_DISABLE_CLANG_WARNING
- EA_ENABLE_GCC_WARNING
- EA_ENABLE_GCC_WARNING_AS_ERROR
- EA_ENABLE_CLANG_WARNING
- EA_ENABLE_CLANG_WARNING_AS_ERROR
# Fixes
FixNamespaceComments: true
# Misc stuff
PointerAlignment: Left
ReferenceAlignment: Left
BinPackParameters: true
BinPackArguments: true
BreakBeforeInlineASMColon: OnlyMultiline
# Break/reflow
ReflowComments: false
BreakStringLiterals: false
BreakBeforeBinaryOperators: None
# This would be useful but its broken in a bunch of scenarios. Notably when
# preprocessor macros are involved if the macro isnt in the list of macros it'll
# often be seen a separate section and add incorrect empty lines.
SeparateDefinitionBlocks: Leave
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortFunctionsOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortEnumsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
# AllowShortCompoundRequirementOnASingleLine: true # requires clang-format 18 and doesnt actually work, so commented out
Cpp11BracedListStyle: false
# Return type on its own line
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
PenaltyReturnTypeOnItsOwnLine: 1000
# Indents & Alignments
NamespaceIndentation: None
IndentGotoLabels: false
IndentWrappedFunctionNames: false
AlignConsecutiveBitFields: true
AlignEscapedNewlines: Left
AlignTrailingComments:
Kind: Always
OverEmptyLines: 0
# Classes & Constructors
BreakConstructorInitializers: BeforeComma
PackConstructorInitializers: Never
ConstructorInitializerAllOnOneLineOrOnePerLine: true
AllowAllConstructorInitializersOnNextLine: true
AccessModifierOffset: -1
# Templates & Concepts
BreakBeforeConceptDeclarations: Always
SpaceAfterTemplateKeyword: Yes
AlwaysBreakTemplateDeclarations: Yes
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
IndentRequiresClause: false
# Brace/new line styling
BreakBeforeBraces: Custom
BraceWrapping:
AfterFunction: true
BeforeElse: true
AfterClass: false
AfterControlStatement: MultiLine
AfterEnum: false
AfterNamespace: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
SplitEmptyFunction: true