forked from fifengine/fifechan
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clang-format
More file actions
124 lines (115 loc) · 3.55 KB
/
.clang-format
File metadata and controls
124 lines (115 loc) · 3.55 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
118
119
120
121
122
123
124
# A complete list of style options can be found at:
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#
# Google C++ Style Guide
# https://google.github.io/styleguide/cppguide.html
# You can disable formatting of a piece of code like so:
#
# int formatted_code;
# // clang-format off
# void unformatted_code ;
# // clang-format on
# void formatted_code_again;
#
Language: Cpp
# Basic indentation and spacing rules:
IndentWidth: 4
ContinuationIndentWidth: 4
UseCRLF: false
Standard: c++20
UseTab: Never
MaxEmptyLinesToKeep: 1
AccessModifierOffset: -4
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: true
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortFunctionsOnASingleLine: Empty
AllowShortBlocksOnASingleLine: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortLambdasOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
# Configure each individual brace in BraceWrapping
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
AfterControlStatement: false
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBraces: Custom
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
ColumnLimit: 120
CompactNamespaces: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
ExperimentalAutoDetectBinPacking: true
FixNamespaceComments: true
IndentCaseLabels: false
IndentGotoLabels: false
IndentPPDirectives: BeforeHash
IndentFunctionDeclarationAfterType: false
NamespaceIndentation: All
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 10
PenaltyBreakComment: 60
PenaltyBreakFirstLessLess: 20
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
SpaceAfterControlStatementKeyword: true
SpaceBeforeParens: ControlStatements
SpaceBeforeAssignmentOperators: true
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpacesInAngles: false
SpaceInEmptyBlock: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
# int* value instead of int *value
DerivePointerAlignment: false
PointerAlignment: Left
PointerBindsToType: true
SpaceAroundPointerQualifiers: After
# Prefer "east const", placing `const` after the type: int const instead of const int
QualifierAlignment: Right
SortIncludes: true
IncludeBlocks: Regroup
IncludeCategories:
# Headers in <> from specific external libraries.
- Regex: '^<(fmt|gtest|gmock|SDL|spdlog|allegro)(\/)?([A-Za-z0-9.\/-_])+>'
Priority: 3
- Regex: '^<fifechan/widgets/.*\.hpp>$'
Priority: 4
- Regex: '^<fifechan/.*\.hpp>$'
Priority: 5
- Regex: '^<[a-z0-9_]*\.hpp>$'
Priority: 6
# C++ standard library. These includes are all lowercase.
- Regex: '^<[a-z0-9_]*>$'
Priority: 7